← Catalog

@q5m-ai/cli

Native q5m CLI plus Pi and OMP extensions for direct agent-network access.

Package

Install

Install with PiG

pig install npm:@q5m-ai/cli

Install with Pi

pi install npm:@q5m-ai/cli
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./dist/q5m.js"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.1 (README.md). PiG does not review it.

q5m CLI

Chat with your q5m agents from the terminal, continue conversations from the web app, or connect q5m tools to Pi, OMP and other agent hosts.

Quick start

Requires Node.js 22.19 or newer.

npm install --global @q5m-ai/cli
q5m auth login
q5m

Login opens your browser. Check that the approval code matches, then approve the connection. Credentials stay in your local profile; never paste API keys or browser tokens into chat.

Useful account commands:

q5m --version
q5m auth status
q5m auth logout

Chat in your terminal

Run q5m in a terminal, or use q5m --human. Choose New or Resume, then select an agent and Home. Conversations share their history with the web app; changes are not automatically pushed between open clients.

Key or commandAction
Enter / Alt-EnterSend / new line
PageUp / PageDownScroll the conversation
Ctrl-Home / Ctrl-EndJump to oldest / latest output
/new / /resumeStart or resume a conversation
/history / /watchRefresh history / observe running work
Ctrl-OShow connection and conversation details
/help / /quitHelp / exit

Exiting or detaching does not cancel work already running. Cancellation is a separate, explicit action.

Pi and OMP

Install the extension for your runtime:

pi install npm:@q5m-ai/cli
# or
omp install npm:@q5m-ai/cli

Reload extensions, then use /q5m login to connect. Your q5m agents' tools become available in the host. Destructive tools require interactive confirmation.

Use /q5m status to check the connection, /q5m reload after configuration changes, and /q5m logout to disconnect.

Login from a remote agent

For hosts that cannot keep a command running during browser approval:

q5m auth login --begin --json

Open the returned approval URL. After approval, complete login using the returned login_id:

q5m auth login --complete LOGIN_ID --json
q5m auth status --json

Use the same profile and backend for both steps. If approval is still pending, wait the reported retry_after interval before completing with the same ID. Do not start another login automatically after a timeout.

Sessions and scripts

Find conversations and read their history:

q5m sessions launch-options --json
q5m sessions list --limit 10 --json
q5m sessions inbox --json
q5m sessions history SESSION_ID --json

Start a conversation with a prompt from a UTF-8 text file:

REQUEST_ID=$(node -e 'console.log(crypto.randomUUID())')
q5m sessions start --agent q --home personal \
  --request-id "$REQUEST_ID" --input-file prompt.txt --json

Keep the returned session ID to continue that exact conversation. Generate and retain a new request ID for each new message:

NEXT_REQUEST_ID=$(node -e 'console.log(crypto.randomUUID())')
q5m sessions send SESSION_ID --request-id "$NEXT_REQUEST_ID" \
  --input-file follow-up.txt --json
q5m sessions watch SESSION_ID --request-id "$NEXT_REQUEST_ID" --json

A timeout does not mean the request failed or was cancelled. Preserve the request ID and original prompt, then inspect or watch that request rather than blindly sending it again. Allow at least 150 seconds in an outer command runner; accepted or queued work is not necessarily complete.

For persistent agent integrations, run q5m --agent. It uses JSONL protocol 1: wait for ready, send one command, and await its terminal result before sending the next. See the interactive guide for framing and examples.

Agents and tools

q5m agents
q5m agent q
q5m route "plan a trip"
q5m tools
q5m call get_memory --input '{"path":"/profile"}'

Use q5m tools AGENT to inspect an agent's tools before calling them. Add --json for structured output; redirected output is JSON automatically. Direct tool calls do not add messages to a conversation.

Homes

Choose the default Home for tools and memory:

q5m context
q5m context personal
q5m context GROUP_ID

Session commands use the Home saved with the conversation, not the default tool context. New sessions require an explicit --home.

More help

Login defaults to production. Credentials are stored in ~/.config/q5m/config.json; Q5M_CONFIG_HOME selects another profile. Keep development and production profiles separate and never copy credentials between them.