CLI quickstart
Set up an engine profile, run a parameterized query and choose your next CLI task.
Use oc to query a database from your terminal. Start with an engine profile; add a separate management profile only if you need account or organization commands.
- Install the approved previewCheck the archive and the reported CLI version.
- Create an engine profileSupply the endpoint and credentials required by this CLI version.
- Check the connectionRun doctor before sending database commands.
- Run a small queryInspect both the returned output and the exit code.
Before you start
These instructions are for CLI preview 0.6.0-dev.20261020, supplied as an approved archive. Install the CLI first.
Ask your administrator for the engine HTTPS origin, tenant ID, database username, transport bearer and database-user key. This CLI preview uses those settings; the new SDK's OC_URL / OC_TOKEN setup is a separate contract.
1. Check the executable
oc version
oc helpPut global options such as --profile and --output before the command.
2. Load your credentials
Use a secret manager or a hidden prompt. Choose your shell:
$env:OC_BEARER = Read-Host 'Engine transport bearer' -MaskInput
$env:OC_DB_KEY = Read-Host 'Database-user key' -MaskInput3. Save the connection settings
Replace the three placeholders with your engine settings:
oc --profile development init --non-interactive --endpoint ENGINE_ORIGIN --tenant TENANT_ID --db-user DB_USER
oc --profile development --output table doctor --target enginePrefer prompts? Run oc init. Setup checks health and schema access before saving, and keeps existing profiles. A successful check does not grant permission to query every table.
Keep credentials for another terminal
oc --profile development credentials save --kind engineThis stores them in your OS credential store, not the profile file. Clear the temporary environment variables and run doctor in a fresh process to check the saved credentials. See credential-store requirements.
4. Run a query
List available schemas, then send a query that needs no table:
oc --profile development schema list
oc --profile development --output table sql --query 'SELECT $1 AS value' --params '[7]'The query should show a value column containing 7. It creates no rows. If schema listing is empty, this constant-value query still does not need a table.
$1 binds the first parameter. Single quotes keep the shell from expanding it. Use schema show SCHEMA_IDENTIFIER to inspect an identifier returned by schema list.
For longer SQL, save a UTF-8 file and run oc --profile development sql --file query.sql.
Choose your next task
Use the terminal menu
Run oc ui for SQL, graph, vector, full-text and administration menus. Use b to go back, q to quit and :cancel to cancel. oc ui --render --plain previews the menu without contacting a server.
Open an SQL session
oc --profile development sql shellEnd SQL with an unquoted semicolon. Use \status to inspect a tracked transaction, \r to clear input and \q to quit. See sessions and recovery before using transactions or query history.
Search an existing index
Use oc --profile development search indices to list Elasticsearch-compatible indexes. Then send a search request. Results contain one page; partial results return exit code 4.
Follow relationships
Use oc graph query for Cypher, or neighbors, bfs and path for traversals. You need existing graph data and a registered relation. Graph commands.
Search vectors
Use oc vector list, then query with a JSON embedding. The embedding must match the stored dimension and model; the CLI does not generate one. Vector commands.
Search text fields
Use oc fts search TABLE FIELD --text 'search words'. Native full-text search uses a table and field, while oc search uses an Elasticsearch-compatible index. Full-text commands.
Add account access when needed
Management login is optional and requires a console that supports this CLI preview's approval flow. It does not grant SQL access.
oc --profile work login --browser --endpoint https://app.originchaindb.com --org YOUR_ORG_UUID
oc --profile work whoami
oc --profile work --output table db listCompare the code shown in the terminal and browser before approving. The engine profile development remains separate from management profile work. Management login options.
Organization administration
Use a separately approved org:admin management profile and the required organization permissions. Existing read-only tokens remain read-only. Administration commands.
Create or change a role
Read permission list before choosing capability keys. Role updates can replace the entire permission list. Role options.
Invite or update a member
Use team invite to send an invitation and team set-role for an existing member. An invitation sends email; membership begins after acceptance. Team options.
Use scripts and completion
Use JSON for automation and check the exit code before consuming output. A command can return partial results and still fail. Output and exit codes · Shell completion.
SQL is not automatically retried. After a timeout, check whether the statement took effect before sending it again.
Remove local access
oc --profile development credentials remove --kind engine
oc connection remove development
oc --profile work logoutLog out any administrative profile too, then clear temporary environment credentials. These commands remove local settings; they do not delete the database or revoke remote credentials. Revoke remote access separately in the console. Update or uninstall the executable.