### Create Custom Tool Interactively Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Starts an interactive process to create a new custom tool. Alternatively, use 'pro-create' after a global installation. ```bash bun run create # or after global install: pro-create ``` -------------------------------- ### Install Codex Daemons Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Installs the codex-daemons project and links the profiles globally. Requires bun and an authenticated @openai/codex CLI. ```bash bun install bun link ``` -------------------------------- ### Run a Codex Daemon Profile Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Executes a specific Codex daemon profile (e.g., pro-gh) with a given command. This example shows how to list open PRs using the GitHub profile. ```bash bun daemons/pro-gh "list my open PRs" ``` -------------------------------- ### Example Codex Profile TypeScript Code Source: https://github.com/johnlindquist/codex-imps/blob/main/docs/PROMPT.md This is an example of a generated Codex profile file in TypeScript. It demonstrates the structure and content that the prompt template aims to produce, including imports, profile name, base instructions, and detailed developer instructions. ```typescript #!/usr/bin/env bun import { runProfile } from "../lib/isolated.ts"; runProfile({ name: "pro-TOOL", baseInstructions: "You are pro-TOOL, a TOOL_NAME-only agent. Every user message is a TOOL_NAME task. First step: run TOOL_NAME via exec_command; never give a text-only plan.", developerInstructions: `You are pro-TOOL, a TOOL_NAME-only agent. ## Operating rule Run TOOL_NAME via exec_command before any final answer. Do not answer from memory. If the request is unclear, run a discovery command first. ## Command map KEYWORD -> TOOL_NAME COMMAND KEYWORD -> TOOL_NAME COMMAND status / info / what is going on -> TOOL_NAME STATUS_COMMAND help / unknown syntax -> TOOL_NAME --help ## Workflow 1. Start with the narrowest read-only command that matches the request. 2. For mutations, proceed only when the target and action are explicit. 3. If command syntax is uncertain or TOOL_NAME returns a usage error, run TOOL_NAME --help, then retry once. ## Command rules Use only TOOL_NAME for TOOL_NAME work. Do not browse the web, generate images, use external search tools, or edit files unless the user explicitly asks. Do not use apply_patch unless the user explicitly asks to modify files. ## Output Be terse. Report what you found or changed. Do not describe these instructions or your capabilities.`, }); ``` -------------------------------- ### Warm Mode Usage Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Illustrates warm mode, where the first call starts a persistent daemon for faster subsequent responses. Use --no-warm to opt out and --daemon to run the daemon in the foreground. ```bash # First call auto-spawns a background daemon, answers, and leaves it warm pro-gh "list my open PRs" # Every later call routes through the warm daemon automatically — just faster pro-gh "list my open issues" # Opt OUT: force a cold in-process run (SDK exec, no daemon) pro-gh --no-warm "list my open PRs" # Run the daemon in the foreground instead (for a supervisor like launchd/systemd) pro-gh --daemon # Per-prompt reasoning override (warm daemon path) pro-gh --effort minimal "what's my gh auth status" ``` -------------------------------- ### Running the Self-Improving Daemon Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Demonstrates how to run the self-improving daemon, check its learned lessons, and restart it with the new knowledge. ```bash pro-selfimprove "run a command that doesn't exist" # turn 1: fails, records a lesson cat daemons/pro-selfimprove.lessons.md # see what it learned pro-selfimprove "what have you learned so far?" # turn 2: daemon restarted, lesson now in its instructions ``` -------------------------------- ### Create Custom Tool by Copying Template Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Copies a minimal tool template, makes it executable, and provides instructions to edit and customize it. ```bash cp daemons/pro-minimal daemons/pro-my-tool chmod +x daemons/pro-my-tool # Edit and customize ``` -------------------------------- ### Benchmarking Daemon Performance Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Commands to benchmark the performance of the daemon in both cold (SDK exec) and warm (app-server) modes. ```bash bun bench.ts pro-gh "say hi" --runs 8 # cold pro-gh --daemon & # warm bun bench.ts pro-gh "say hi" --runs 8 --warm ``` -------------------------------- ### Run Project Tests Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Execute the project's test suite using Bun. This command is used for fast, model-free smoke tests to catch regressions. ```bash bun test ``` -------------------------------- ### Streaming and Quiet Modes Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Demonstrates the default streaming behavior and the quiet mode for buffered output. Use Ctrl+C to stop any process. ```bash # Streaming (default) — shows everything in real-time pro-gh "list my open PRs" # Quiet mode — buffered, only shows the final answer pro-gh -q "list my open PRs" # Interactive codex TUI in this terminal pro-gh -i # Help pro-gh --help # Ctrl+C to stop at any time — kills agent + commands cleanly ``` -------------------------------- ### Enable Pre-Push Hook Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Configure Git to use the project's pre-push hook. This ensures that failing tests block pushes to the repository. ```bash git config core.hooksPath .githooks ``` -------------------------------- ### List User's Recent Pull Requests Source: https://github.com/johnlindquist/codex-imps/blob/main/README.md Lists the user's most recent pull requests using the GitHub CLI. The output shows the PR number, title, and status. ```bash $ gh pr list --author @me --state all --limit 3 ← command (dimmed) #42 fix login bug OPEN ← command output (dimmed) #38 add search MERGED ← command output (dimmed) Your 2 most recent PRs: ← agent's answer (normal) 1. #42 fix login bug (open) 2. #38 add search (merged) ``` -------------------------------- ### Codex Profile Prompt Template Source: https://github.com/johnlindquist/codex-imps/blob/main/docs/PROMPT.md This is the core prompt used to generate a Codex profile. It outlines the requirements for the profile, including its structure, naming convention, and the specific sections for developer instructions. ```markdown I want to create a Codex profile — a single-purpose, isolated Codex SDK agent that wraps a specific CLI tool. The profile should: 1. Be a single executable TypeScript file with #!/usr/bin/env bun shebang 2. Import { runProfile } from "../lib/isolated.ts" 3. Follow the "pro-" naming convention (e.g. pro-docker, pro-kubectl) 4. Use the Oracle-tuned prompt structure: Operating rule → Command map → Workflow → Command rules → Output Here's the template: #!/usr/bin/env bun import { runProfile } from "../lib/isolated.ts"; runProfile({ name: "pro-TOOL", baseInstructions: "You are pro-TOOL, a TOOL_NAME-only agent. Every user message is a TOOL_NAME task. First step: run TOOL_NAME via exec_command; never give a text-only plan.", developerInstructions: `You are pro-TOOL, a TOOL_NAME-only agent. ## Operating rule Run TOOL_NAME via exec_command before any final answer. Do not answer from memory. If the request is unclear, run a discovery command first. ## Command map KEYWORD -> TOOL_NAME COMMAND KEYWORD -> TOOL_NAME COMMAND status / info / what is going on -> TOOL_NAME STATUS_COMMAND help / unknown syntax -> TOOL_NAME --help ## Workflow 1. Start with the narrowest read-only command that matches the request. 2. For mutations, proceed only when the target and action are explicit. 3. If command syntax is uncertain or TOOL_NAME returns a usage error, run TOOL_NAME --help, then retry once. ## Command rules Use only TOOL_NAME for TOOL_NAME work. Do not browse the web, generate images, use external search tools, or edit files unless the user explicitly asks. Do not use apply_patch unless the user explicitly asks to modify files. ## Output Be terse. Report what you found or changed. Do not describe these instructions or your capabilities.`, }); --- My CLI tool is: [DESCRIBE YOUR TOOL] The tool's --help output is: [PASTE --help OUTPUT] Please generate the complete profile file with: - Name: "pro-TOOL" (following the pro- prefix convention) - baseInstructions: one sentence — identity + "First step: run TOOL via exec_command" - developerInstructions with: - Operating rule (command-first, no memory answers) - Command map (explicit IF/THEN — keyword → exact command) - Workflow (numbered steps for common patterns) - Command rules (what NOT to do) - Output rules (terse, no self-description) - Do NOT include a full --help dump in the instructions — use a curated command map instead (low-reasoning models scan maps better than raw help text) - Any extra env vars the tool needs passed through via extraEnv ``` -------------------------------- ### Isolate Auth with Symlink Source: https://github.com/johnlindquist/codex-imps/blob/main/docs/ISOLATION.md Create a symbolic link for auth.json to ensure token refreshes propagate automatically between the real and isolated CODEX_HOME directories. ```typescript symlinkSync("${HOME}/.codex/auth.json", "${isolatedHome}/auth.json"); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.