DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to call the agent from a shell script with print mode and JSON with Star CLI

Run one prompt with star -p and --json, then parse the NDJSON output in a script.

Short answer: Install the CLI with npm install -g @cryer/star-cli; then Store your provider key in an environment variable or in ~/.star-cli/.env, using /connect in the REPL once; run star -p "hi" to confirm that print mode works. All steps.

Authorization notice. Star CLI is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Credentials. Keep provider API keys in environment variables or ~/.star-cli/.env, never hard-coded in the script or committed to git.

Who it is forA developer automating a repeated text or code task who needs the agent to run unattended inside a script.

The problemThe interactive REPL cannot run unattended, so a script needs a non-interactive entry point.

The outcomeA script that runs one prompt and reads machine-readable NDJSON lines.

What you need first

  • Node.js 20 or newer
  • pnpm, only if you build from source
  • An API key for an OpenAI, Anthropic, or OpenAI-compatible provider, set via /connect or config.toml

Steps

  1. Install the CLI with npm install -g @cryer/star-cli.
  2. Store your provider key in an environment variable or in ~/.star-cli/.env, using /connect in the REPL once.
  3. Run star -p "hi" to confirm that print mode works.
  4. Add --json to the same command, for example star -p "<your prompt>" --json, to get NDJSON output. (inferred, check the README)
  5. Parse the output line by line in your script and handle each JSON object.

Prompt for your agent

Using the cryer/star-cli repo, write a shell script that runs `star -p "<prompt>"` with --json and writes the output to <output-file>. Verify that every output line parses as valid JSON.

Caveat. The README mentions --json for scripting but gives no example combined with -p, so test the exact flags before you rely on them.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for cryer/star-cli and "Call the agent from a shell script with print mode and JSON"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer