Use the CodePinion CLI
Sign in, choose the right organisation and repository, manage planning and hosted apps, use AI chat, and connect an optional server agent.
On this page
- 1. Sign in to the right CodePinion environment
- 2. Choose the organisation and repository
- 3. Review the board and manage a task
- Add a group of tasks from a plan file
- 4. Use the AI from your terminal
- 5. Inspect and operate a hosted app
- 6. Discover tools and use JSON output
- What else is in the CLI?
- Exit statuses
- 7. Connect your own server (optional)
- Install a CLI update
- Optional local skills and MCP servers
- Common situations
- “It says I am not signed in”
- “It chose the wrong repository”
- “The command asks for approval”
- “A deploy succeeded but the app is still unhealthy”
- “A write timed out”
- Find command help
The CodePinion CLI lets you work with repositories, planning, hosted apps and the CodePinion AI from a terminal. It signs in through your browser, remembers a selected organisation and repository, and checks write requests before sending them.
For install choices and operating-system-specific commands, start with Download and install the native CLI. This page is the user guide for what to do after installation. The Claude Code integration is a separate plugin and is not required to use this CLI.
1. Sign in to the right CodePinion environment
The CLI keeps credentials separate for each CodePinion platform. Production is the initial default; use --platform playground when you mean the playground. A playground login does not sign you in to production.
codepinion version
codepinion --platform playground auth login
codepinion --platform playground auth status
The CLI displays a short code and opens a browser approval page. If the terminal is on a server, run auth login --no-browser and open the printed URL on a device where you are already signed in. Do not paste a password, API token or model-provider key into a prompt or chat.
codepinion --platform playground auth login --no-browser
If your OS keyring is unavailable on a headless machine, file storage is an explicit option. It is unencrypted, so restrict access to the account and machine that need it:
codepinion --platform playground auth login --no-browser --credential-store file
Use auth status to check the signed-in identity. auth logout removes the local credential only. auth revoke also invalidates the token on the server. If a write asks for recent browser approval, run auth elevate, approve it in your browser, then retry the command.
2. Choose the organisation and repository
First list the organisations and repositories you can access:
codepinion --platform playground orgs list
codepinion --platform playground repos list
Choose IDs from those results. This avoids accidentally doing work in a similarly named repository or in your personal account when you intended an organisation repository:
codepinion --platform playground context use --org ORGANISATION_ID --repo REPOSITORY_ID
codepinion context show
For a personal repository, use organisation ID 0:
codepinion --platform playground context use --org 0 --repo REPOSITORY_ID
The CLI verifies the selected target before saving it. You can also set --platform, --org and --repo on an individual command. The CodePinion platform (prod or playground) is separate from an app's production/staging environment and from a Kubernetes context.
When working inside a Git checkout, check which CodePinion repository the folder matches:
codepinion whereami
codepinion link
codepinion link --save
If the checkout is ambiguous, inspect the candidates and choose the intended repository explicitly before saving the link. A saved checkout link helps the CLI target the right board; it does not change Git remotes or push code.
3. Review the board and manage a task
Use the board commands to inspect the work before changing it:
codepinion graph
codepinion tasks list
codepinion tasks show TASK_ID
codepinion sprints list
For example, if the login redirect needs a task, preview the request first:
codepinion tasks create --sprint SPRINT_ID \
--title "Fix login redirect" \
--description "Preserve the return URL after sign-in." \
--priority high \
--dry-run
Review the preview. Then repeat without --dry-run to create it:
codepinion tasks create --sprint SPRINT_ID \
--title "Fix login redirect" \
--description "Preserve the return URL after sign-in." \
--priority high
The CLI checks the target repository, duplicate task names and creation limits. If the task already exists, inspect it rather than creating a near-duplicate. Use tasks update --id TASK_ID with only the fields you intend to change. For assignment, use assign and unassign; updating a task does not silently replace its assignees.
Add a group of tasks from a plan file
For a larger plan, save a JSON file and ask the CLI to validate it. A plan can target an existing sprint by ID, or describe a sprint to create:
{
"sprint": 18,
"tasks": [
{
"title": "Add login redirect regression test",
"description": "Cover the return URL after OAuth sign-in.",
"priority": "high",
"points": 2
},
{
"title": "Document sign-in troubleshooting",
"priority": "medium",
"points": 1
}
]
}
Preview the batch:
codepinion plan --file plan.json
The preview reports the exact number of records it would create. Only after reviewing and agreeing to that count, apply with the same file and count:
codepinion plan --file plan.json --apply --approved 2
codepinion verify --sprint 18 --expect-tasks 7
Replace 7 with the expected total tasks in that sprint after the changes. If a batch stops partway through or a write has an unknown result, list the sprint and inspect what exists before retrying; do not replay the whole batch blindly.
4. Use the AI from your terminal
Start a full-screen chat:
codepinion ask
Or send a single question:
codepinion ask "What is blocking the active sprint?"
codepinion ask --plain "Summarise the latest deploy for this repository."
The AI uses the selected CodePinion organisation/repository context. In interactive chat, /target lets you choose the local machine or an enrolled server. Host observations are bounded and read-only by default. A change request displays the specific operation and asks for approval; a non-interactive command cannot approve it for you.
Useful interactive controls include:
/help Show available controls
/history Find and resume a conversation
/target Choose Local machine or an enrolled server
/mode ask Ask questions without making changes
/mode plan Prepare a plan before changing anything
/mode agent Let the agent work with approval for writes
/focus task TASK_ID Keep board tools focused on a task
/board Work with planning records in chat
/new Start a new conversation
Use ask or plan when you want advice or a proposed approach. agent can make eligible changes after approval. auto may automatically approve eligible edits, so choose it only when you intend to delegate that level of control. Irreversible actions may require additional confirmation.
For scripting, use --plain and provide a prompt. The process returns a result; it does not bypass approval requirements:
codepinion ask --plain "Explain the latest CI failure" </dev/null
5. Inspect and operate a hosted app
Hosted-app commands use the selected repository. If a repository contains several hosted apps, specify the app slug so the command cannot choose the wrong one:
codepinion apps list
codepinion apps show storefront
codepinion apps deploys storefront
codepinion apps logs storefront --tail 100
You can list an app's environment-variable names without revealing their values:
codepinion apps env storefront
The CLI deliberately hides secret values. Be careful with env-set: shell arguments can be saved in shell history or visible to local process-inspection tools. Prefer the CodePinion UI for secret values, or use a protected shell/session and clear the history according to your environment's policy. Variables injected by a managed add-on cannot be edited manually; manage the add-on instead.
An environment update takes effect on the app's next deploy. Preview a deployment request before sending it:
codepinion apps deploy storefront --dry-run
After reviewing the exact app and target, run the deployment:
codepinion apps deploy storefront
codepinion apps deploys storefront
To add a custom domain, add it, create the DNS record the CLI reports, then verify it. A verified domain may not serve until the next app deployment:
codepinion apps domain-add storefront app.example.com --dry-run
codepinion apps domain-add storefront app.example.com
codepinion apps domains storefront
codepinion apps domain-verify storefront app.example.com
apps logs returns a bounded recent tail. It is useful for a quick check, not a substitute for a live streaming log viewer or a full log archive.
6. Discover tools and use JSON output
List tools available to the signed-in account and inspect their descriptions before invoking one:
codepinion tools list
codepinion tools list --search database
Listing a tool does not grant new access. Tool calls still use the account's permissions and the tool's own validation. tools invoke is an advanced interface; use it only when you understand the tool's effect and arguments.
For scripts, add --json. Structured results go to standard output; diagnostics go to standard error:
codepinion --platform playground --json repos list > repos.json
The CLI returns paginated account lists rather than silently loading an unbounded number of records. Check pagination metadata before assuming the first page is the complete list.
What else is in the CLI?
Use codepinion --help for the exact commands in your installed version. The main command groups are:
| Command group | Typical use |
|---|---|
orgs, repos, context, whereami, link | Find accessible work and choose the organisation/repository for commands. |
tasks, sprints, epics, goals, graph | Read and update the planning board, including dependencies, assignments and blocked work. |
apps | Inspect hosted apps, add-ons, variables, deploy history, domains and recent runtime logs. |
ask | Chat with the CodePinion AI from a terminal, optionally targeting an enrolled server. |
tools | Discover or invoke account-authorised CodePinion tools. |
agent | Enrol and inspect customer servers, run supported diagnostics, and request policy-controlled operations. |
skill, mcp | Install and manage local AI skills and MCP tools after reviewing and trusting them. |
data | Run supported read-only checks for local Redis or Kafka metadata. |
update, auth, version | Update a manually installed CLI, manage sign-in, and inspect the installed build. |
Some local telemetry/adapter commands are experimental and depend on the build. They inspect the machine running the CLI; they are not a replacement for CodePinion's hosted monitoring or a general-purpose remote cluster console. Check codepinion telemetry --help and the command-specific help before using them.
Exit statuses
When the CLI is used in a script, its exit status identifies the broad outcome:
| Code | Meaning | What to do |
|---|---|---|
0 | Success | Continue. |
1 | Usage, guard or target mismatch | Correct the command or selected repository. |
2 | Sign-in rejected or expired | Check the platform and sign in again. |
3 | API/network error or tool refusal | Read the error and retry only when appropriate. |
4 | Recent browser approval needed | Run auth elevate, approve, then retry. |
5 | Policy refusal or approval missing/declined | Review the policy and exact proposed action; do not bypass it automatically. |
6 | The write ran but verification did not match | Inspect the affected resource and resolve the mismatch. |
7 | Cancelled | No automatic retry is implied. |
8 | A write's final outcome is unknown | Read the target resource before retrying; the server may have completed it. |
7. Connect your own server (optional)
You do not need a server agent for ordinary CLI, board or hosted-app use. Enrol one only if you want CodePinion to inspect that server. In CodePinion, open Settings → Servers → Connect a server and create an invitation. On the server, enrol the agent using the one-use invitation. Keep the default observation-only policy unless you deliberately configure and review permitted operations.
After enrolment, inspect server status and available operations before requesting a change:
codepinion agent list
codepinion agent show SERVER_ID
codepinion agent catalog
Read-only diagnoses can target configured resources. A restart or other change first displays a plan; approve only the exact plan you reviewed. The server's local policy can still reject it. A result marked unknown means you must inspect the resource before retrying.
See Download and install the native CLI for the server installation steps. See Device sign-in and approval for browser approval and token revocation.
Install a CLI update
For a manually installed binary, check for and install updates through the signed update channel:
codepinion update --check
codepinion update
If you installed a beta build, select the beta channel explicitly:
codepinion update --check --channel beta
codepinion update --channel beta
Package-managed installations should use the operating system's package manager instead. The CLI does not update itself in the background.
Optional local skills and MCP servers
The CLI can load local skill bundles and MCP tool servers for codepinion ask. These can run code as your user or expose tools that change data, so do not install or trust one just because it was suggested in a chat. Inspect its files, scripts, tool schemas and effects first. Trust applies to the exact contents/schema; a change requires reviewing and trusting it again.
codepinion skill list
codepinion skill install /path/to/skill
codepinion skill inspect SKILL_NAME
For MCP, start by registering the server and inspecting its tools. Tools default to write effect until classified; trust only after checking what the server can access and do:
codepinion mcp list
codepinion mcp add stdio example /absolute/path/to/server -- --safe-mode
codepinion mcp inspect example
Remote MCP servers and credentials require additional care. Use the installed CLI's mcp --help and mcp credential --help for the supported setup options; never put a bearer token directly in a command or source file.
Common situations
“It says I am not signed in”
Check the platform as well as the account. A production token is not a playground token:
codepinion --platform playground auth status
codepinion --platform playground auth login
“It chose the wrong repository”
Stop before writing. Inspect the active context and checkout match, then select the correct IDs:
codepinion context show
codepinion whereami
codepinion --platform playground context use --org ORGANISATION_ID --repo REPOSITORY_ID
“The command asks for approval”
Read the target and proposed change. Approve only if both are correct. If it says fresh browser approval is required, run auth elevate, complete the browser step, and retry.
“A deploy succeeded but the app is still unhealthy”
Check the deployment record and recent runtime logs, then check the app's health in CodePinion. A successful request to start deployment does not itself prove the new app process is healthy:
codepinion apps deploys storefront
codepinion apps logs storefront --tail 200
“A write timed out”
Do not immediately repeat it. The server may have completed the write even if the response was lost. Read the task, deployment, or other target first and retry only if it is clear the change did not happen.
Find command help
The command reference is available from the installed CLI:
codepinion --help
codepinion apps --help
codepinion apps deploy --help
codepinion ask --help
The implementation and supported command set can change between releases. Prefer the installed command's --help output when a flag shown in an older guide is not accepted.