Daptin CLI
CLI client for Daptin — the headless CMS and API server.
All Daptin entities are accessed uniformly via CRUD commands, and all Daptin actions can be executed uniformly via execute. Common workflows such as cloud storage and file asset uploads also have ergonomic wrapper commands.
Discovery
The CLI is self-describing. Start with:
daptin-cli --help
daptin-cli list --help
daptin-cli execute --help
daptin-cli describe action --help
daptin-cli oauth --help
daptin-cli integration --help
daptin-cli llm --help
daptin-cli storage --help
daptin-cli asset --help
For any Daptin action, use describe action before execute to see whether the action needs an instance reference id and which input fields it accepts:
daptin-cli describe action integration install_integration
daptin-cli execute integration install_integration --reference-id <integration_reference_id>
Install
Homebrew (macOS / Linux)
brew install daptin/tap/daptin-cli
Scoop (Windows)
scoop bucket add daptin https://github.com/daptin/scoop-bucket
scoop install daptin-cli
Debian / Ubuntu
Download the .deb from the latest release:
sudo dpkg -i daptin-cli_*.deb
RPM (Fedora / RHEL)
sudo rpm -i daptin-cli_*.rpm
Go
go install github.com/daptin/daptin-cli@latest
Binary download
Grab a binary from the releases page for linux, macOS, or Windows (amd64 / arm64).
Quick Start
# Point to your Daptin server
daptin-cli context add myserver http://localhost:6336
daptin-cli context set myserver
# Sign in (signin is an action like any other)
daptin-cli execute user_account signin email=admin@example.com password=secret
# List tables
daptin-cli list --columns table_name,is_top_level world
# List rows
daptin-cli list --columns name,email --page-size 20 user_account
# Discover action requirements
daptin-cli describe action integration install_integration
Context Management
Contexts store server endpoints and auth tokens in ~/.daptin/config.yaml.
daptin-cli context add prod https://api.example.com
daptin-cli context add local http://localhost:6336
daptin-cli context set prod
daptin-cli context list
Override per-command with --endpoint:
daptin-cli --endpoint http://localhost:6336 list world
CRUD
List rows
daptin-cli list <entity> [flags]
Flags: --columns, --page-size, --page, --sort, --filter, --include
# List with column selection and pagination
daptin-cli list --columns table_name,reference_id --page-size 50 world
# Sort descending by created_at
daptin-cli list --sort -created_at --page-size 10 document
# Filter
daptin-cli list --filter name=administrators usergroup
daptin-cli list --filter "status is active" task
daptin-cli list --filter "table_name like %doc%" world
daptin-cli list --filter "name is admin;email contains example" user_account
# Include relations
daptin-cli list --include user_account_id document
Get a single row
daptin-cli get <entity> <reference_id> [--columns col1,col2]
daptin-cli get world 019228bb-a7cd-773b-a465-c92d7c54d956
daptin-cli get --columns table_name,is_top_level world 019228bb-a7cd-773b-a465-c92d7c54d956
Create, Update, Delete
# Create with key=value pairs
daptin-cli create document document_name=report.pdf document_extension=pdf
# Create with JSON
daptin-cli create document '{"document_name":"report.pdf","document_extension":"pdf"}'
# Create with a complete JSON:API payload, including required relationships
daptin-cli create mail_account '{"data":{"type":"mail_account","attributes":{"username":"probe@example.test"},"relationships":{"mail_server_id":{"data":{"type":"mail_server","id":"<mail_server_ref>"}}}}}'
# Read larger JSON payloads from a file or stdin
daptin-cli create asset --input-file ./asset.json
cat asset.json | daptin-cli create asset --input-stdin
# Update
daptin-cli update document <reference_id> document_name=updated.pdf
daptin-cli update document <reference_id> --input-file ./attributes.json
# Delete
daptin-cli delete document <reference_id>
create and update accept only one payload source at a time: positional
arguments, --input-file, or --input-stdin. File and stdin JSON input is
limited to 16 MiB.
Traverse relationships
daptin-cli related <entity> <reference_id> <relation_column>
daptin-cli related document <ref_id> user_account_id
# Select a page, or fetch every page with a hard safety bound
daptin-cli related world <ref_id> usergroup_id --page-size 100 --page 2
daptin-cli related world <ref_id> usergroup_id --all --page-size 100 --max-pages 100
# Set attributes on the generated relationship row while relating
daptin-cli relate world <document_world_ref> usergroup_id <users_group_ref> permission=1032192
# Update attributes on an existing relationship row
daptin-cli update-relation world <document_world_ref> usergroup_id <users_group_ref> permission=1032192
Actions
All Daptin actions — built-in or custom — can be executed with execute.
daptin-cli execute <entity> <action_name> [key=val ...]
For nested or generated action attributes, pass one bounded JSON object directly,
from a file, or from stdin:
daptin-cli execute world my_action --input-json '{"options":{"mode":"safe"},"items":["one","two"]}'
daptin-cli execute world my_action --input-file ./request.json
cat request.json | daptin-cli execute world my_action --input-stdin
The JSON object contains the action attributes themselves; do not wrap it in an
HTTP {"attributes": ...} envelope. Positional arguments, --input-json,
--input-file, and --input-stdin are mutually exclusive. JSON flag, file, and
stdin input is limited to 16 MiB. --input-stdin cannot be combined with
--interactive, because both modes need stdin.
Authentication
# Sign in
daptin-cli execute user_account signin email=admin@example.com password=secret
# Sign up
daptin-cli execute user_account signup name=Alice email=alice@example.com password=secret passwordConfirm=secret
# Sign in with 2FA
daptin-cli execute user_account verify_otp email=admin@example.com mobile_number=+1234567890 otp=123456
On successful signin, the token is automatically saved to the active context.
Other actions
# Generate random data
daptin-cli execute world generate_random_data table_name=products count=100
# Export data
daptin-cli execute world export_data table_name=document format=json
# Upload file to cloud store
daptin-cli execute cloud_store upload_file --reference-id <store_id> path=/uploads
# Download system schema
daptin-cli execute world download_system_schema
# Upload a local file for an action field declared as file.*
daptin-cli execute world upload_system_schema schema_file=@daptin/schema.yaml
For action inputs whose type starts with file., prefix the local path with @.
The CLI serializes that value as the file array Daptin actions expect.
Interactive mode
Prompt for fields based on the action's InFields schema:
daptin-cli execute user_account signin --interactive
# > Email: admin@example.com
# > Password: ****
Password fields are automatically masked.
Instance actions
For actions that require an entity instance, pass --reference-id:
daptin-cli execute cloud_store upload_file --reference-id <cloud_store_id> path=/docs
Use describe action when you are unsure:
daptin-cli describe action cloud_store upload_file
Payment checkout actions
Daptin payment checkout is an application-defined action workflow, not a
provider-specific CLI subsystem. The commands below work only after the
application has installed compatible api_plan, checkout_attempt, and
checkout action definitions, such as Daptin's
payment checkout example.
List plans that remain available for new checkout attempts:
daptin-cli --output json list api_plan \
--filter 'archived_at is empty' \
--columns name,price_monthly_cents,currency,reference_id
Prepare an owned attempt and capture its server-returned reference:
ATTEMPT_ID=$(
daptin-cli --output json execute api_plan prepare_checkout \
--reference-id "$PLAN_REFERENCE_ID" |
jq -r '.checkout_attempt_id'
)
Ask Daptin to create or recover the provider session, then use only the URL
returned by the action for browser navigation:
CHECKOUT_URL=$(
daptin-cli --output json execute checkout_attempt begin_checkout \
--reference-id "$ATTEMPT_ID" |
jq -r '.checkout_url'
)
printf '%s\n' "$CHECKOUT_URL"
After the provider returns, have Daptin retrieve and verify provider state, then
read the durable attempt:
daptin-cli --output json execute checkout_attempt refresh_checkout \
--reference-id "$ATTEMPT_ID"
daptin-cli --output json get checkout_attempt "$ATTEMPT_ID"
The CLI never accepts the provider secret, treats redirect parameters as proof
of payment, verifies payment locally, or creates api_member directly. Those
permission, credential, idempotency, verification, and transaction boundaries
remain owned by the installed Daptin actions. A denied action returns non-zero;
there is no provider or membership fallback. See the full
Payments and Checkout guide
for the server-side contract and production considerations.
Describe
Table schema
daptin-cli describe table document
Shows columns (name + type) and available actions.
Action schema
daptin-cli describe action document createDocument
Shows whether the action is instance-bound, whether --reference-id is required, the action's InFields, and an example execute command.
Table Defaults
Use table defaults to inspect and update schema-level defaults before creating
rows in setup scripts:
daptin-cli table defaults get oauth_connect
daptin-cli table defaults set oauth_connect --permission 1618275
daptin-cli table defaults group add oauth_connect users --permission 1618275
daptin-cli table defaults ensure oauth_connect --permission 1618275 --group users:1618275
These commands update the table's world_schema_json; restart Daptin or run the
supported reload flow before relying on changed defaults in a long-running
server process.
OAuth And Integrations
OAuth provider setup and OpenAPI integration workflows have first-class wrappers. The generic create, list, describe action, and execute commands still work, but these commands keep the common lifecycle discoverable and avoid passing large specs as shell arguments.
# Register a Daptin OAuth provider client app
export APP_CALLBACK_URL=https://app.example.com/auth/daptin/callback
daptin-cli oauth app register \
--name "App Login" \
--redirect-uri "$APP_CALLBACK_URL" \
--scope openid \
--scope profile \
--scope email \
--grant authorization_code \
--grant refresh_token
# Inspect provider-side OAuth apps and rotate a confidential client secret
daptin-cli oauth app list
daptin-cli oauth app describe <client_id_or_reference_id>
daptin-cli oauth app rotate-secret <client_id_or_reference_id>
# Use the returned client_id/client_secret to configure Daptin self-login
export DAPTIN_BASE_URL=https://daptin.example.com
export DAPTIN_SELF_CLIENT_SECRET=...
daptin-cli oauth connect create daptin-login \
--client-id <client_id> \
--client-secret-env DAPTIN_SELF_CLIENT_SECRET \
--auth-url "$DAPTIN_BASE_URL/oauth/authorize" \
--token-url "$DAPTIN_BASE_URL/oauth/token" \
--profile-url "$DAPTIN_BASE_URL/oauth/userinfo" \
--scope openid,profile,email \
--redirect-uri "$APP_CALLBACK_URL" \
--profile-email-path email \
--allow-login \
--pkce \
--access-type-offline \
--update
# Create an OAuth connection without putting the client secret in shell history
export ASANA_CLIENT_SECRET=...
daptin-cli oauth connect create asana.com \
--client-id "$ASANA_CLIENT_ID" \
--client-secret-env ASANA_CLIENT_SECRET \
--auth-url https://app.asana.com/-/oauth_authorize \
--token-url https://app.asana.com/-/oauth_token \
--profile-url https://app.asana.com/api/1.0/users/me \
--scope default
# Start the browser OAuth flow and list token references after callback
daptin-cli oauth login-url asana.com
daptin-cli oauth tokens list --provider asana.com
Import large OpenAPI specs from files, URLs, or stdin:
daptin-cli integration validate-spec --spec-file ./provider.yaml
daptin-cli integration import \
--provider asana.com \
--spec-file ./asana_oas.yaml \
--auth oauth2 \
--oauth-connect asana.com \
--update
daptin-cli integration install asana.com
Transport extensions can be patched during import for generated facade specs:
daptin-cli integration import \
--provider linear.app \
--spec-file ./linear-openapi.yaml \
--auth custom_credentials \
--auth-spec-file ./linear-auth.json \
--set-operation-transport listIssues=graphql \
--set-operation-upstream-path listIssues=/graphql \
--set-graphql-document-file listIssues=./list_issues.graphql \
--set-graphql-operation-name listIssues=ListIssues \
--validate
For gRPC services without reflection, embed a descriptor set during import:
daptin-cli integration import \
--provider grpc.example \
--spec-file ./grpc-facade.yaml \
--auth custom_credentials \
--auth-spec-file ./grpc-auth.json \
--set-operation-transport Search=grpc \
--set-grpc-service Search=grpc.testing.SearchService \
--set-grpc-method Search=Search \
--grpc-descriptor-set Search=./search.protoset \
--validate
The CLI can also invoke protoc with --grpc-proto Search=./proto/search.proto
and optional --grpc-proto-path Search=./proto; descriptor blobs are embedded
in the imported spec but hidden from normal discovery output.
Discover installed operations through Daptin's scoped integration discovery endpoints: