- Build with AI Agents covers the SaladCloud skills, the documentation MCP server, and what an API key lets an agent do. Read its API key section before you give any agent access.
- Agent Operations holds the runbooks an agent follows: which sources to trust, which actions need your go-ahead, and how to verify a change.
Why Give an Agent the CLI
An agent can call the SaladCloud API directly, but the CLI removes most of the ways that goes wrong:- One command per task, with built-in documentation.
saladcloud <command> --helplists the flags and examples for the installed version, so the agent does not have to rely on what it remembers. - Errors say how to fix them. With
-o json, a failure is one JSON object on stderr whosehintfield is the next step. - Exit codes separate the cases an agent must treat differently: bad input, a missing resource, an authentication problem, a rate limit, a network failure.
- Writes check themselves.
create,update, andscalecompare what the API did with what was asked for and print awarning:ornote:line when they differ. - The API key stays out of the conversation. The agent runs commands that read a saved key; no command prints it.
Step 1: Install the CLI and Log In Yourself
Setup is your job, not the agent’s. Install the CLI, then log in from your own terminal:login saves your API key, organization, and project in a config file in your user profile. From then on, any
saladcloud command the agent runs on that machine uses the saved key, and you never paste the key into a chat, a
prompt, or a file in the repository.
If the agent should also open SSH sessions or copy files, or use the AI Gateway, do those setup steps yourself too:
SALAD_API_KEY,
SALAD_ORGANIZATION, and SALAD_PROJECT as secret environment variables instead. See
Authenticate Without Logging In.
Step 2: Add the SaladCloud Section to Your Project
Coding agents can read project instruction files, such asCLAUDE.md for Claude Code or AGENTS.md for tools that
support it. Other tools may use different filenames. agent init writes a short SaladCloud section into the selected
file. Run it in your project’s root folder:
- How workloads run on SaladCloud: as container groups on interruptible nodes, with ephemeral local disk and one port reachable through the Container Gateway.
- To use
saladcloud -o json <command>rather than raw HTTP, to act on an error’shint, and what each exit code means. - That setup belongs to you. When a command says to run
saladcloud login, the agent asks you to run it in your own terminal, and it never asks for a key in the chat. - To pass
--organd--projecton each command rather than change your saved settings, and to ask you when a name is not found rather than pick one from a list. - To read the warnings after a write, and to confirm with you before
container-groups delete. - To test ports, probes, and authentication locally before deploying, and how to debug a container that fails at startup.
- To install the SaladCloud skills before any non-trivial work.
If you use more than one agent in the same project, run the command once for each file:
<!-- SALADCLOUD START --> and <!-- SALADCLOUD END --> markers. Running the command again
replaces the section in place and leaves the rest of the file alone, so run it again after you upgrade the CLI to pick
up the current text.
Check which instruction files your agent actually loads. For a tool that uses a different file, pass its path with
--file; a generated file only helps when the agent reads it.
Step 3: Install the SaladCloud Skills
The section thatagent init writes carries only facts that stay true between releases. Detailed, task-specific
guidance lives in the SaladCloud skills, which the section tells the agent to install. Installing them yourself lets you
choose which skills and which agents:
Step 4: Make Sure the CLI Never Waits for Input
A few setup commands, such aslogin, prompt when they are run at a terminal. Some agent tools run commands under a
pseudo-terminal, where a prompt would wait for an answer that never comes. Set SALAD_CLI_NO_PROMPT in the agent’s
environment so that the CLI never prompts and instead fails with a hint that says what to do:
.claude/settings.json
Step 5: Tell the Agent Which Organization and Project to Use
Give the agent the organization and project by their URL names, either in your prompt or in the project instruction file. The agent then passes them on each command:SALAD_ORGANIZATION and SALAD_PROJECT in its environment.
Use scope flags only where the command’s help supports them. inference is organization-scoped and rejects --project.
ai-gateway rejects both flags and bills the organization associated with its separate Gateway key.
When nothing sets a project, the CLI uses the project named
default and prints a warning. In an organization with
several projects, always name the project so that the agent does not act on default by accident.Decide What the Agent May Do Without Asking
Most agent tools let you allow some commands and require approval for others. A reasonable split for the SaladCloud CLI:
Three commands deserve particular care:
container-groups deleteis immediate and unconfirmed. The CLI has no prompt and no dry run, and a deleted group’s name can never be used again in that project.container-groups updaterestarts every instance when it changes the image, command, environment variables, probes, or gateway settings.availabilityis read-only but expensive for the platform. An agent should run it once before a deployment, not in a loop.
Try It
With the setup done, start your agent in the project and give it a task that names the organization, the project, and where it must stop. For example:What the Agent Sees
Knowing what the CLI gives the agent helps you read a session and write better instructions. Results. With-o json, resource and action commands print a JSON document on stdout, and a list is
{"items": [...]}. Logs stream JSON lines; SSH/SFTP sessions, shell completion, and help keep their native output. A
waiting write such as create --wait prints its result only after the wait succeeds, but doctor can print results and
still fail. Always check the exit code. In v0.1.0, a successful update means the configuration settled, not that every
instance runs the new version or passes its readiness probe.
Errors. A failed command prints one JSON object as the last line of stderr and exits with a non-zero code. This is
what the agent gets when no API key is available:
saladcloud login in your own terminal.
Exit codes. 1 is a general error, 2 a usage error, 3 an authentication failure, 4 not found, 5 rate
limited, 6 invalid input, 7 a network error, and 10 an AI Gateway billing refusal. The
exit code table has the details.
Warnings and notes. After a write, the CLI reports on stderr anything the API changed or ignored, as warning: and
note: lines. These never contain a secret: an environment variable’s value is described as (set) or (changed), not
printed.
Timeouts and uncertain results. A timeout or interrupted wait does not cancel work already accepted by SaladCloud.
Inspect the named group or returned job ID before retrying. Do not automatically repeat a job submission or Gateway
completion whose outcome is uncertain; it can create duplicate work or another charge.
A one-shot
saladcloud container-groups ssh <group> -- <command> exits with code 1 even when the command succeeded,
because the SaladCloud relay does not pass exit codes back. The SaladCloud section tells the agent about this; if you
write your own instructions, mention it so that the agent checks the command’s output instead.Keep the Agent Up to Date
The CLI changes between releases, and an agent may have learned an older version. Two commands close the gap without network access:saladcloud agent init again in each project to refresh the SaladCloud section.
Report Problems
If the CLI misbehaves during an agent session, for example a crash, a wrong exit code, or output that contradicts--help, the SaladCloud section tells the agent to say so and offer to draft a bug report. Reports go to the CLI’s
issue tracker, with the output of
saladcloud version, the exact command, and the error line from stderr. Check that the report contains no credentials
before you submit it.
For gaps in this documentation or in the skills, use the documentation MCP server’s feedback tool or the
support page.