tp context show before running commands. Add root --json before the command when machine parsing needs JSON output; use root --profile <name> only to override the active profile.
CLI context and preparation
Use the installedtp --help and tp apps publish --help when checking version
support. Select the intended profile, organization and project through the usual
global CLI options; do not copy credentials into the source tree. Examples below
assume that context is already selected.
The current publication API requires a companion HTML Dynamic UI in the same
project. Create or select it with tp dynamic-ui or client.canvas.dynamic_ui.
It is an access/resource anchor; the container provides the actual app UI:
uiId as --ui-id. Inspect the returned mapping rather than
guessing an ID. Provision needed Tables with tp db tables create --body @table.json
or reuse a suitable existing Table. Do not change existing column contracts to
fit an unrelated demo.
Publish source or an existing image
--request-id; inspect the recorded state before
creating another request. --wait 0 advances one step without polling. Do not
automatically resubmit an operation explicitly reported as terminally failed.
For a prebuilt image replace --source with
--image registry.example/projects/p4/apps/my-app@sha256:<digest> using the actual
organization Registry address. tp registry push returns an immutable digest when
pushing from a Docker-capable environment. Source publication combines remote
build, push and deployment; an Agent Workspace does not need Docker-in-Docker.
The compressed context is limited to 50 MiB. The CLI archive does not interpret
.dockerignore: in Git it includes tracked files and nonignored untracked files,
subject to built-in exclusions for common credential/cache paths. Use .gitignore
for local-only files and inspect tracked files separately. Outside Git, stage a
dedicated source directory containing only intended build inputs. Keep
.dockerignore for Docker’s own context handling. Build the production frontend
in a Docker stage rather than uploading node_modules. Include a wheel only when
needed by the app; do not embed package-feed passwords in the Dockerfile.
Optional SDK permissions:
- Repeat
--table-read/--table-writefor exact Table IDs. --lakehouse-readallows the delegated read-only statement API for the project.- Repeat
--project-permissionfor supported Canvas, Flow or Module read scopes; inspect CLI help for the current accepted values.
tp apps show my-app, then publish using a new request UUID
and --replaces "$OLD_RELEASE". Use --replaces-stopped only if that exact release
is stopped. --replace-current is a convenience for the initial submission;
retain the resolved previous release for retries. Stop an exact release with:
Canvas application page
Use the existing configured SDK client to create a dedicated app page:/canvas/<page-id> on the selected TP host.
For an existing HTML-only app the source is
{"kind": "dynamic-ui", "uiId": "<ui-id>"}. A dashboard/document embedding instead
uses a widget of kind hosted-app with config: {"appId": "my-app"}. Dedicated
application pages have no widget frames or document blocks.
Backend Python SDK
Install the released ThinkPlatform client available in the target environment. The privateThinkPlatform package also includes the SDK. Keep imports independent
of Agent/Flow runtime modules.
TABLE_ID is app configuration and must match the declared permissions. The
headers include a short-lived invocation handle and bound org/project; retain
neither headers nor client in global state or background jobs. The SDK routes via
the platform-injected broker. The application receives no TP user access token.
Use tp.db.rows.create(TABLE_ID, values) and
tp.db.rows.update(TABLE_ID, row_id, values) for writes, following the installed
method signatures. For a project Lakehouse read: