You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@every-env/spiral-cli

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@every-env/spiral-cli

CLI for Spiral API - create content from your terminal

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
16
300%
Maintainers
4
Weekly downloads
 
Created
Source

spiral-cli

A command-line interface for interacting with the Spiral API from your terminal.

Installation

Prerequisites

  • macOS (Safari cookie extraction)
  • Bun >= 1.1.0
  • Full Disk Access for terminal (macOS Sonoma+)

Install from source

git clone <repo>
cd spiral-cli
bun install

Build standalone binary

bun run build
# Output: dist/spiral

Quick Start

# Interactive chat
bun run src/cli.ts chat

# Send a single message (agent-native)
bun run src/cli.ts send "Write a haiku about coding"

Usage

Core Commands

# Interactive chat mode
spiral chat [--session <id>] [--new]

# Send single message (non-interactive, for scripts/agents)
spiral send <message> [--session <id>] [--json] [--attach file...]

# List sessions
spiral sessions [--json] [--limit N]

# View session history
spiral history <session-id> [--json] [--limit N]

# Authentication
spiral auth status
spiral auth clear

Content Management

# Writing styles
spiral styles [--json]

# Workspaces
spiral workspaces [--json]

# Draft management
spiral drafts --session <id> [--json]
spiral draft view <id> --session <id>
spiral draft edit <id> --session <id>      # Opens in $EDITOR
spiral draft update <id> --session <id> --content "New text"  # Agent-native
spiral draft versions <id> --session <id>
spiral draft restore <id> --session <id> --versionId <vid>

Notes & Suggestions

# Local notes/scratchpad
spiral notes                    # List notes
spiral notes add "Remember X"   # Add note
spiral notes clear              # Clear all
spiral notes remove <id>        # Remove specific

# Suggestions (parsed from AI responses)
spiral suggestions              # List pending
spiral suggestions preview <id>
spiral suggestions apply <id> --session <id>
spiral suggestions dismiss <id>

Options

OptionDescription
--help, -hShow help
--version, -vShow version
--session, -s <id>Resume session by ID
--jsonOutput as JSON (for scripting)
--quiet, -qSuppress spinners and progress
--new, -nStart new session
--limit <N>Limit results
--debug, -dEnable debug output
--attach, -a <files>Attach files to message
--style <id>Use writing style
--workspace <id>Use workspace context
--force, -fSkip confirmations
--content <text>Content for agent-native draft update
--title <text>Title for draft
--versionId <id>Version ID for restore

REPL Commands (in chat mode)

CommandDescription
/helpShow all commands
/exitExit chat
/clearClear screen
/historyShow session history
/sessionsList all sessions
/newStart new session
/session <id>Switch to session
/debugToggle debug mode

Content Management:

CommandDescription
/draftsList drafts in session
/draft view <id>View a draft
/draft edit <id>Edit in $EDITOR
/draft versions <id>Show version history
/stylesList writing styles
/style <id>Set writing style
/workspacesList workspaces
/workspace <id>Set workspace

Notes & Suggestions:

CommandDescription
/note <text>Add a note
/notesList all notes
/notes clearClear all notes
/suggestionsList pending suggestions
/apply <id>Apply a suggestion
/dismiss <id>Dismiss a suggestion
/attach <files>Queue files for next message

Agent-Native Usage

spiral-cli is designed for use by AI agents and scripts:

# JSON output for parsing
spiral send "Summarize this article" --json

# Pipe input
echo "Explain quantum computing" | spiral send --json

# With file attachments
spiral send "Analyze this data" --attach data.csv --json

# Agent-native draft updates (no $EDITOR)
spiral draft update <id> --session <sid> --content "Updated content"

# Check exit codes
spiral send "Hello" && echo "Success" || echo "Failed"

Exit Codes

CodeMeaning
0Success
1General error
2Authentication failed
3API error
4Network error
5Invalid arguments

Environment Variables

VariableDescription
SPIRAL_API_URLOverride API endpoint
SPIRAL_TOKENProvide auth token directly (for CI)
EDITOREditor for draft editing (default: vi)
DEBUGEnable verbose logging

Configuration

spiral-cli stores local configuration in ~/.config/spiral-cli/:

  • Current workspace and style preferences
  • Local notes/scratchpad
  • Draft cache for offline editing

Authentication

spiral-cli automatically extracts your session from Safari cookies. No manual token management needed.

Requirements:

Granting Full Disk Access

  • Open System Preferences > Privacy & Security
  • Click Full Disk Access
  • Add your terminal app (Terminal.app, iTerm2, etc.)

Security Notes

  • $EDITOR Integration: Only trusted editors (vim, nvim, nano, code, etc.) are allowed
  • File Attachments: Path traversal and sensitive paths are blocked
  • Temp Files: Created with restrictive permissions, securely deleted

Development

# Run in dev mode
bun run src/cli.ts --help

# Type check
bun run typecheck

# Run tests
bun test

# Lint
bun run lint

# Build binaries
bun run build:all

License

MIT

Keywords

spiral

FAQs

Package last updated on 04 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts