Command Palette

Search for a command to run...

#+TITLE: ::
:PROPERTIES:
:TITLE
:TAGS
:FILENAME
:END:

hactar.el

Installation

At the moment is hactar is distributed solely through git. You can install it using straight:

(use-package hactar  :straight '(hactar :type git :host github :repo "hactar-project/hactar.el"))

Usage

hactar.el Cheatsheet

Including other Org Files in Context

hactar-lit-mode has built in support for org-transclusion. Use transclusion instead of links to include things. This can help you re-use context but avoid duplication

Extending hactar.el using

API Reference

hactar

embark actions

Hactar search function return things as the hactar category and come with some built in actions.

hactar-action-insert-as-src-blocks

Will insert the selected doc as src blocks at point

hactar-action-insert

Insert the selected doc at point

hactar-action-yank

Copy the selected doc into the kill ring

hactar-action-send

Send the doc at point as context to the current Hactar instance.

vars

hactar-shell

The shell to use for hactar instances.

  • comint

  • vterm

  • eshell

hactar-context

The variable that contains the current context. Context gets added to the system prompt.

hactar-project-path

Contains the folder path to the project so that src blocks have the correct path. When not set defaults to projectile-project-root

hactar-db-path

The default path for the sqlite DB that hactar users. Default

hactar-content-path

The path to the hactar-repo. Defaults ot the environment variable HACTAR_CONTENT_PATH

local vars

hactar-process

The buffer corresponding to the hactar, aider, or gptel process being used. If no local buffer is set it will default to instance associated with the project the buffer belongs to. If no instance exists at all it launche a new hactar instance.

functions

hactar-run

Run a hactar instance in comint, vterm, or eshell instance depending on the valuue of hactar-shell

With C-u get prompted to edit arguments passed to hactar.

hactar-clear
hactar-reset
hactar-add
hactar-drop
hactar-add-window
hactar-drop-window
hactar-sonnet

A wrapper around hactar-run that sets the sonnet model as default

hactar-deepseek

A wrapper around hactar-run that sets the deepseek model as default.

hactar-gemini

A wrapper around hactar-run that sets the gemini model as default.

hactar-gemini-flash

A wrapper around hactar-run that sets the gemini flash model as default.

hactar-gpt5

A wrapper around hactar-run that sets the gpt5 model as default.

hactar-gpt5-mini

A wrapper around hactar-run that sets the gpt5 model as default.

hactar-o3-mini

A wrapper around hactar-run that sets the o3-mini model as default.

hactar-create

Run a new hactar instance and pass it the create command.

WIll do the following:

  • Launch a new hactar-lit-mode buffer

    • This buffer becomes your context

  • Call hactar-insert-starter and allow you to select a starter to insert at point

  • Runs hactar-run and attaches the instance to the buffer

hactar-send
Description

Send the context at point to the current hactar instance in a DWIM fashion.

  • If in a headline it assumes everything up to the parent should be sent as the prompt

  • If on a headline then everything below it is sent as the prompt.

  • The current buffer by default

  • Hit C-u hactar-lit-send and the context at point will become part of the system prompt and you will be prompted to enter a prompt.

  • Hit C=u 1 hactar-lit-send to edit the system prompt/context before sending it.

hactar-send-region

Send the current buffer's content as context to the Hactar instance.

hactar-send-buffer

Send the current buffer's content as context to the Hactar instance.

hactar-send-command

Send a command to the current hactar instance. Will popup a list of all commands in hactar and let you select one via completing-read.

hactar-search

Search API docs, api references, and starters. The default is to open the file to the headline (all stuff in Hactar is org-mode files)

Actions:

  • RET (default): Open the selected doc in a new buffer.

  • Insert the doc at point using hactar-action-insert.

  • Insert the doc as source blocks using hactar-action-insert-as-src-blocks.

  • Yank the doc into the kill-ring using hactar-action-yank.

  • Send the doc as context using hactar-action-send.

hactar-search-docs

Search documentation. Excludes API, starters, etc.

Actions:

  • RET (default): Open the selected doc in a new buffer.

  • Insert the doc at point using hactar-action-insert.

  • Insert the doc as source blocks using hactar-action-insert-as-src-blocks.

  • Yank the doc into the kill-ring using hactar-action-yank.

  • Send the doc as context using hactar-action-send.

hactar-search-api

Search API documentation.

Actions:

  • RET (default): Open the selected doc in a new buffer.

  • Insert the doc at point using hactar-action-insert.

  • Insert the doc as source blocks using hactar-action-insert-as-src-blocks.

  • Yank the doc into the kill-ring using hactar-action-yank.

  • Send the doc as context using =hactar

hactar-search-starters

Search starter kits.

Actions:

  • RET (default): Open the selected doc in a new buffer.

  • Insert the doc at point using hactar-action-insert.

  • Insert the doc as source blocks using hactar-action-insert-as-src-blocks.

  • Yank the doc into the kill-ring using hactar-action-yank.

  • Send the doc as context using hactar-action-send.

hactar-search-cheatsheets

Search cheatsheets

Actions:

  • RET (default): Open the selected doc in a new buffer.

  • Insert the doc at point using hactar-action-insert.

  • Insert the doc as source blocks using hactar-action-insert-as-src-blocks.

  • Yank the doc into the kill-ring using hactar-action-yank.

  • Send the doc as context using hactar-action-send.

hactar-search-menu

Open a transient to select search funcitons.

  • s: Search everything (hactar-search)

  • d: Search docs (hactar-search-docs)

  • a: Search API (hactar-search-api)

  • t: Search starters (hactar-search-starters)

  • c: Search cheatsheets (hactar-search-cheatsheets)

hactar-insert

Insert the selected the documentation at point. A doc is a org-mode headline

hactar-insert-docs

Search documentation and insert the selection at point.

hactar-insert-api-reference

Search API references and insert the selection at point.

hactar-insert-starter

Search starters and insert the selection at point.

hactar-insert-file

Select a file from the Hactar content repo and insert its contents at point.

hactar-insert-file-as-src-blocks

Select a file from the Hactar content repo and insert its contents wrapped in a source block.

hactar-insert-menu

Open a transient menu with:

  • d: Insert docs (hactar-insert-docs)

  • a: Insert API reference (hactar-insert-api-reference)

  • s: Insert starter (hactar-insert-starter)

  • f: Insert file (hactar-insert-file)

  • b: Insert file as source blocks (hactar-insert-file-as-src-blocks)

hactar-update-repo

Update the hactar content repo

hactar-lit-mode

vars

hactar-lit-ai-backgend

hactar-lit-mode can use different backends. Only the hactar backend supports all the features but the core send context + prompt works with three different backends.

  • values

    • 'hactar

    • 'gptel

    • 'aider

  • defaults to 'hactar

local vars

hactar-lit-hactar-buffer

The buffer corresponding to the hactar instance being used. For the most part you will not need to teach this var. It exists so programmatic tooling can be built

functions

hactar-lit-insert-menu

Alias to hactar-insert-menu

hactar-lit-insert

A wrapper function around hactar-insert. It is a DWIM function

  • If dired files are in the kill ring then insert the files as org src blocks at point (if in org-buffer)

    • if not in an org-buffer insert the files contents on after another

  • Default to calling hactar-insert

hactar-lit-send
Description

Wraps hactar-send

hactar-create-finish

Send the current buffer as the prompt to the create command to a hactar instance

hactar-comint-mode

A wrapper around comint mode that holds the current hactar instance

functions

hactar-comint-clear

Clear the current history by sending the clear command to the hactar instance

hactar-comint-reset

Reset hactar's

hactar-eshell-mode

hactar-vterm-mode

hactar-shell-mode

A wrapper mode that uses shell-maker

hactar.el Workflows

Literate/Spec Driven Development

A core feature of hactar.el is a literate mode called hactar-lit-mode. It dervies from org-mode and wraps an instance of Hactar.

You can use it to manage all the context.