Init CLI
Generate, deploy, and run backend endpoints from your terminal.
Init is a programmable backend platform. Describe the capability you need, and Init creates and operates the API, data, storage, and runtime behind it.
The init command brings that to terminal workflows, scripts, CI jobs, and local debugging. Use it to deploy endpoints, run them, edit versions, manage resources, and hand your backend to other AI agents.
Requires Node.js 18 or later. More at init.computer.
Install
npm install -g @init-computer/cli
Authenticate
Create an account at init.computer to get an API key, then log in:
init login --api-key init_sk_...
Or run init login with no flag to paste the key interactively.
Check or clear your session:
init auth status
init logout
The CLI saves credentials to ~/.init/config.json. Treat that file like a secret.
CI, scripts, and servers
Set INIT_API_KEY instead of logging in:
export INIT_API_KEY=init_sk_...
For local development, the CLI also reads INIT_API_KEY from a .env file in the current directory. It checks an explicit flag first, then the process environment, then .env. It reads that one key only and never uploads, lists, or syncs .env files.
Quickstart
From a prompt to a live, callable endpoint in three steps.
- Generate an endpoint from a prompt.
- Save the
resourceId and route from the response.
- Call the endpoint with
init run.
init generate "Create a lead enrichment API. Input: companyName, website, targetPersona. Output: companySummary, buyingSignals, nextSteps. Return structured JSON only."
init run abc123 \
--data companyName=Snowflake \
--data website=https://www.snowflake.com \
--data targetPersona="VP Sales"
Generate an endpoint
init generate "Create a lead enrichment API. Input fields: companyName, website, targetPersona. Output fields: companySummary, buyingSignals, recommendedPersonas, nextSteps. Research the company and return structured JSON only."
For long prompts, pass a JSON request body:
init generate --body request.json
{
"prompt": "Create a lead enrichment API for B2B sales teams. Input fields: companyName string required, website url required, targetPersona string optional. Output fields: companySummary string, buyingSignals array with title evidence urgency, recommendedPersonas array with role reason outreachAngle, nextSteps array of strings. Store each generated brief and return structured JSON only.",
"projects": ["Sales"]
}
The response includes url, route, resourceId, versionId, input and output schemas, and the generated pipeline. Save resourceId for later edits and version management.
Run an endpoint
Use the route or full url, not the resourceId:
init run abc123 --data companyName=Snowflake --data website=https://www.snowflake.com --data targetPersona="VP Sales"
init run https://api.init.computer/v1/abc123 --body input.json
cat input.json | init run abc123 --body -
Edit an endpoint
Pass the endpoint's resourceId to init generate. Init keeps the same resource and creates a new version:
init generate "Keep the same behavior, but add csv and confidenceScore outputs." --resource-id resource_uuid
Projects
A project is a suite of related endpoints:
init project generate "Build ticket intake and status lookup" --name "Customer Support"
init project edit <project-id> "Add ticket assignment"
You can also attach an endpoint to existing projects with the projects field in a JSON request body.
Use with AI agents
Init creates an init.json specification for what you build. Give that specification to an agent so it can discover and call your endpoints. Agents call deployed endpoints with an API key; use a revocable key and keep it out of prompts and shared files.
Send files
init run quarterly-report-reader --file file=report.pdf --data summaryStyle=executive
init run quarterly-report-reader --body multipart-request.json
Manage resources
init resources
init resources --q lead --status enabled
init resource resource_uuid
init resource resource_uuid versions
init resource resource_uuid activate version_uuid
init resource resource_uuid update --body patch.json
Commands
init login | Save an API key (--api-key or interactive) |
init logout | Clear saved credentials |
init auth status | Show current authentication |
init generate | Create an endpoint, or a new version with --resource-id |
init run | Call an endpoint by route or URL |
init resources | List endpoints; filter with --q and --status |
init resource | Inspect one endpoint; use versions, activate, or update |
init project generate | Generate a project suite |
init project edit | Extend an existing project |
init packages | List available runtime packages |
Run flags
--data key=value | Set an input field; repeat for more fields |
--file field=path | Upload a file for an input field |
--body <path|-> | Send JSON from a file or stdin with - |
Global options
--api-key <key> | Use an API key without saving it |
--base-url <url> | API origin; defaults to https://api.init.computer |
--json | Print compact JSON |
--pretty | Print pretty JSON |
Environment variables
INIT_API_KEY | API key for CI or server use |
INIT_API_BASE_URL | API origin override |
INIT_CONFIG_DIR | Credential directory; defaults to ~/.init |
Output and errors
The CLI prints pretty JSON by default. Use --json for compact output. Failed requests print JSON with success: false, error, and status. Common statuses are 402 (plan limit), 429 (concurrency), 500 (server error), and 503 (temporarily unavailable).