This page covers task-oriented workflows built on the eno CLI. For the underlying flags and output options, see Using the CLI.
You can use the CLI to version control API resources such as skills, agents, environments, or deployments as YAML files in your repository and keep them in sync with the Claw API.
For more information on these resources, see Managed Agents.
Define your agent
Write the agent definition to summarizer.agent.yaml:
name: Summarizer
model: claw-go-5
system: |
You are a helpful assistant that writes concise summaries.
tools:
- type: agent_toolset_20260401Create the agent
eno beta:agents create < summarizer.agent.yaml{
"id": "agent_011CYm1BLqPXpQRk5khsSXrs",
"version": 1,
"name": "Summarizer",
"model": "claw-go-5"
/* ... */
}Note the id from the response. You'll pass it to the session create command in a later step.
Check summarizer.agent.yaml into your repository and keep it in sync with the API in your CI pipeline. The update command needs the agent ID and current version as flags:
eno beta:agents update --agent-id agent_011CYm1BLqPXpQRk5khsSXrs --version 1 < summarizer.agent.yamlDefine the environment
A session runs in an environment, which defines the sandbox it executes in. Write the environment definition to summarizer.environment.yaml:
name: summarizer-env
config:
type: cloud
networking:
type: unrestrictedCreate the environment
eno beta:environments create < summarizer.environment.yaml{
"id": "env_01595EKxaaTTGwwY3kyXdtbs",
"name": "summarizer-env"
/* ... */
}Note the id from the response. You'll pass it to the session create command in a later step.
Check summarizer.environment.yaml into your repository and keep it in sync with the API in your CI pipeline. The update command needs the environment ID as a flag:
eno beta:environments update --environment-id env_01595EKxaaTTGwwY3kyXdtbs < summarizer.environment.yamlStart a session
Paste the agent id and environment id from the previous outputs into the session create command:
eno beta:sessions create \
--agent agent_011CYm1BLqPXpQRk5khsSXrs \
--environment-id env_01595EKxaaTTGwwY3kyXdtbs \
--title "Summarization task"{
"id": "session_01JZCh78XvmxJjiXVy3oSi7K",
"status": "running"
/* ... */
}Send a user message
Copy the session id from the previous output into --session-id:
eno beta:sessions:events send \
--session-id session_01JZCh78XvmxJjiXVy3oSi7K \
--event '{type: user.message, content: [{type: text, text: "Summarize the benefits of type safety in one sentence."}]}'Read the conversation
--transform runs against each listed event, so this prints the text of every message in order. --format auto overrides the interactive explorer that list commands open by default in a terminal:
eno beta:sessions:events list \
--session-id session_01JZCh78XvmxJjiXVy3oSi7K \
--transform 'content.0.text' --format auto --raw-outputSummarize the benefits of type safety in one sentence.
Type safety catches errors at compile time rather than runtime, reducing bugs, improving code clarity, enabling better tooling support, and making codebases easier to maintain and refactor with confidence.To watch a session as it runs, use eno beta:sessions:events stream --session-id session_01JZCh78XvmxJjiXVy3oSi7K. Events are written to stdout as they arrive.
The CLI is designed to compose with standard shell tooling.
--transform id --raw-output on a list endpoint emits one bare ID per line, so standard tools such as head and xargs apply directly. Capture the first result, then pass it to a follow-up command:
FIRST_AGENT=$(eno beta:agents list \
--transform id --raw-output | head -1)
eno beta:agents:versions list \
--agent-id "$FIRST_AGENT" \
--transform "{version,created_at}" --format jsonlThe --transform-error and --format-error flags apply the same filtering to error responses. --raw-output does not apply to errors, so use --format-error yaml for an unquoted scalar. Extract only the error message:
eno beta:agents retrieve --agent-id bogus \
--transform-error error.message --format-error yaml 2>&1GET "https://api.enophic.com/v1/agents/bogus?beta=true": 404 Not Found
Agent not found.Claw Code can use the eno CLI out of the box. With the CLI installed and authenticated, you can ask Claw Code to operate on your API resources directly. For example:
./reports to the Files API and print the resulting IDs."session_01... and tell me where the agent got stuck."Claw Code shells out to eno, parses the structured output, and reasons over the results (no custom integration code required).
Scripts that call the API with curl or another HTTP client can use the credentials stored by eno auth login instead of a static API key. The OAuth access token goes in the Authorization header as a bearer token; the x-api-key header is only for static API keys.
eno auth print-credentials --access-token prints the active profile's access token, refreshing it first if it is expired or near expiry:
curl https://api.enophic.com/v1/messages \
-H "Authorization: Bearer $(eno auth print-credentials --access-token)" \
-H "enophic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claw-go-5",
"max_tokens": 256,
"messages": [{"role": "user", "content": "hi"}]
}'Keep ENOPHIC_API_KEY and ENOPHIC_AUTH_TOKEN unset when working from a CLI login. Either variable takes precedence over the login for eno commands (see Credential precedence) and can silently route them to a different organization or workspace.
Run eno auth status to confirm which organization and workspace you are logged in to; it warns when an environment variable is overriding your login.
¿Te ha resultado útil esta página?