smoke

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: BSD-3-Clause

README

smoke

About

Smoke is my attempt at an agentic coding assistant. It is tailored to my needs, and is best viewed as a hobby research project. To avoid creating a poor simulacrum of other existing coding assistants, I have not allowed myself to install or use any others up until this point. While I have taken inspiration from various sources such as Thorsten Ball's How to Build an Agent blog post, I have used only smoke to directly help me build smoke. This likely means that I am missing features considered table stakes in the broader coding assistant space, but this is by design.

The raink tool described in this blog post was the direct inspiration for my /rank command. My implementation is incomplete, but I still find it useful.

If people discover this repo and express interest in using smoke, I might write a more helpful README in the future. The code is quite messy in some places, documentation is sparse to nonexistent, and there are likely many bugs. Caveat emptor.

Motivations

  • I wanted to better understand LLM tool use
  • This seemed like a fun project to pursue while I was between jobs
  • I doubted that existing tools would have established insurmountable moats after only a few months of existence
  • If I were to take claims about the massive future importance of these tools at face value, it seemed absurd to let others decide how I could use them
  • Conversations between Dax and Adam on @TerminalDotShop's YouTube channel about their experience building opencode suggested to me that creators of these tools are often just watching each other and copying popular features. I felt that this would lead them all to take similar approaches when that might not be warranted
    • To be clear, I am not criticizing opencode, and I look forward to taking it for a test drive myself. I simply agree with much of their skepticism about the breathless online discourse around these tools. They're not magic, and it is refreshing to hear people with skin in the game say as much
  • Pure hubris

CLI Usage

NAME:
   smoke - Smoke 'em if you got 'em.

USAGE:
   smoke [global options]

VERSION:
   v0.0.1

DESCRIPTION:
   An agentic coding assistant primarily focused on the Go programming language. It only works on one directory at a time, and that directory must contain a .git subdirectory.

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

   LLM Configuration

   --max-tokens int, -t int       The max tokens to return in any given response (default: 8192) [$SMOKE_MAX_TOKENS]
   --model string, -m string      The provider's model to use, or an alias for it [$SMOKE_MODEL]
   --provider string, -p string   One of the following: chatgpt, claude, grok [$SMOKE_PROVIDER]
   --temperature float, -T float  The temperature value to use with the model (default: 1) [$SMOKE_TEMPERATURE]

   Local Configuration

   --debug, -D                    Enable debug logging. (default: false) [$SMOKE_DEBUG]
   --dir DIRECTORY, -d DIRECTORY  The DIRECTORY where your project lives. [$SMOKE_DIRECTORY]
   --session NAME, -s NAME        The NAME of the session, which will be used to derive the log file and plan file names (default: "session") [$SMOKE_SESSION]

   Providers

   --anthropic-api-key string  The API key for Anthropic. Required when provider is "claude" [$ANTHROPIC_API_KEY]
   --openai-api-key string     The API key for OpenAI. Required when provider is "chatgpt" [$OPENAI_API_KEY]
   --xai-api-key string        The API key for xAI. Required when provider is "grok" [$XAI_API_KEY]
Example invocation
smoke -D -t 8192 -T 1 -d . -p grok -m code
Example config file

Smoke will create a config file in ~/.config/smoke/config.json if one does not already exist. The API key fields do not actually do anything at this point. It is primarily useful for defining MCP servers. The default config file contains a fake MCP server that you'll want to delete.

{
  "providers": {
    "anthropic_key": "",
    "openai_key": "",
    "xai_key": ""
  },
  "mcp": {
    "servers": [
      {
        "name": "gopls",
        "command": "gopls",
        "args": ["mcp"],
        "enabled": true,
        "allowed_tools": ["go_*"],
        "denied_tools": [],
        "plan_tools": ["go_*"],
        "env": null
      }
    ]
  }
}

Directories

Path Synopsis
cmd
smoke command
internal
log
Package log handles the basics of configuring the global slog *Logger.
Package log handles the basics of configuring the global slog *Logger.
pkg
commands
Package commands handles "/" commands entered by the user in the prompt box.
Package commands handles "/" commands entered by the user in the prompt box.
commands/handlers/edit
Package edit contains a prompt command that opens all or part of the conversation history in $EDITOR
Package edit contains a prompt command that opens all or part of the conversation history in $EDITOR
commands/handlers/exit
Package exit contains a prompt command that simply exits the program.
Package exit contains a prompt command that simply exits the program.
commands/handlers/export
Package export contains a prompt command that saves the current session to a file in JSON format that can be used with the 'load' command.
Package export contains a prompt command that saves the current session to a file in JSON format that can be used with the 'load' command.
commands/handlers/help
Package help contains a prompt command that displays help for all available commands.
Package help contains a prompt command that displays help for all available commands.
commands/handlers/info
Package info contains a prompt command that displays information about the current session.
Package info contains a prompt command that displays information about the current session.
commands/handlers/load
Package load contains a prompt command that loads a session from a JSON file and replaces the current session with it.
Package load contains a prompt command that loads a session from a JSON file and replaces the current session with it.
commands/handlers/mode
Package review contains a prompt command that asks the model to review the code referenced by the user for red flags
Package review contains a prompt command that asks the model to review the code referenced by the user for red flags
commands/handlers/rank
Package rank contains a prompt command to rank arbitrary large lists through iteration.
Package rank contains a prompt command to rank arbitrary large lists through iteration.
commands/handlers/run
Package run contains a prompt command that runs a tool with user-specified arguments.
Package run contains a prompt command that runs a tool with user-specified arguments.
commands/handlers/save
Package save contains a prompt command that saves the current session to a Markdown file
Package save contains a prompt command that saves the current session to a Markdown file
commands/handlers/session
Package session contains a prompt command that allows the user to modify the current session: - with the argument "new", it will start a new session without wiping the visible history - with the argument "clear", it will start a new session and wipe the visible history
Package session contains a prompt command that allows the user to modify the current session: - with the argument "new", it will start a new session without wiping the visible history - with the argument "clear", it will start a new session and wipe the visible history
commands/handlers/summarize
Package summarize contains a prompt command that asks the LLM to summarize all or a subset of the message history and causes the history to be updated in the UI
Package summarize contains a prompt command that asks the LLM to summarize all or a subset of the message history and causes the history to be updated in the UI
fs
llms
Package llms contains generalized functions and types for interacting with different LLM providers.
Package llms contains generalized functions and types for interacting with different LLM providers.
mcp
models/banner
Package banner contains a Bubbletea model that renders an ASCII art banner for the application for use in the history viewport.
Package banner contains a Bubbletea model that renders an ASCII art banner for the application for use in the history viewport.
models/history
Package history contains a Bubbletea model for holding onto LLM chat history and other items like errors, tool calls, prompt commands, etc.
Package history contains a Bubbletea model for holding onto LLM chat history and other items like errors, tool calls, prompt commands, etc.
models/input
Package input contains a Bubbletea model to allow the user to enter 1) user messages for the LLM, and 2) prompt commands that may work with the session, exit the program, etc.
Package input contains a Bubbletea model to allow the user to enter 1) user messages for the LLM, and 2) prompt commands that may work with the session, exit the program, etc.
models/ui
Package ui contains a Bubbletea model that wraps other models like history.Model and input.Model, as well as the *smoke.Smoke struct that contains and modifies application state.
Package ui contains a Bubbletea model that wraps other models like history.Model and input.Model, as well as the *smoke.Smoke struct that contains and modifies application state.
prompts
Package prompts contains prompts used to interact with the LLMs, such as the overall system prompt that describes how the model should respond to questions or requests for code changes.
Package prompts contains prompts used to interact with the LLMs, such as the overall system prompt that describes how the model should respond to questions or requests for code changes.
providers/chatgpt
Package chatgpt contains an implementation of llms.LLM for OpenAI's ChatGPT.
Package chatgpt contains an implementation of llms.LLM for OpenAI's ChatGPT.
providers/claude
Package claude contains an implementation of llms.LLM for Anthropic's Claude.
Package claude contains an implementation of llms.LLM for Anthropic's Claude.
smoke
Package smoke orchestrates the overall interactions with LLMs, session management, tool execution, prompt command execution, etc.
Package smoke orchestrates the overall interactions with LLMs, session management, tool execution, prompt command execution, etc.
tools
Package tools contains the Tool interface definition, as well as individual Tool implementations such as [ReadFileTool].
Package tools contains the Tool interface definition, as well as individual Tool implementations such as [ReadFileTool].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL