No description
  • Rust 90.3%
  • Shell 6.6%
  • HTML 2.5%
  • Just 0.3%
  • Dockerfile 0.2%
  • Other 0.1%
Find a file
2026-08-16 01:28:10 +00:00
.forgejo
crates/rs9p-patched
Formula
scripts
src Avoid re-hashing already tagged files 2026-08-15 21:27:18 -04:00
.gitignore
AGENTS.md
Cargo.lock
Cargo.toml chore: bump version to v0.0.229 2026-08-16 01:28:10 +00:00
docker-compose.yml
Dockerfile
install.sh
justfile Add ship command to automate commit and push via Ollama 2026-08-15 20:00:14 -04:00
README.md

Corten

A Rust-based file tagging system. Tag files, query them with boolean expressions, and browse the tag tree through a 9P virtual filesystem.

Quick Start

# Install
cargo build --release --features ninep

# Initialize the database (run once)
./target/release/corten init

# Tag a file
corten tag myfile.txt work,important

# Search by tags (boolean queries)
corten files "work and not archived"

CLI Commands

Command Description
corten init Initialize the database and configuration
corten tag <file> <tags> Add comma-separated tags to a file (e.g. corten tag a.txt work,important)
corten tags List all tags in the database
corten files "<query>" List files matching a boolean tag expression
corten new-tag <name> <description> Create a new tag with a description
corten edit-tag <name> [new_name] [description] Edit a tag's name and/or description
corten suggest [path] Get AI tag suggestions for a file or directory
corten mount [mountpoint] Mount the 9P filesystem (default: /mnt/corten)
corten mount --foreground Run the 9P server in the foreground (root only; useful for debugging)
corten unmount [mountpoint] Unmount the 9P filesystem
corten daemon Run the file watcher daemon (auto-tag new files)
corten mcp [port] Run the MCP server for AI tools (default: 3456)

Boolean Query Syntax

The corten files command supports boolean tag queries:

Example Meaning
important Files tagged "important"
important AND readme Files with both tags
important OR readme Files with either tag
important AND NOT readme "important" but not "readme"
(work OR personal) AND important Grouped with parentheses
school Hierarchical: matches school, school/art, anything under school/...

9P Mounting

The 9P mount exposes your tag tree as a virtual filesystem. Each top-level tag becomes a directory; the files inside are the files bearing that tag. Hierarchical tags (e.g. school/art) appear as nested directories.

# As root, the easiest path:
sudo corten init        # one-time: sets up the corten group, sudoers, capabilities
sudo corten mount       # mounts at /mnt/corten by default
sudo corten mount ~/my-tags  # or anywhere you can write to

# As a regular user (after `sudo corten init`):
corten mount             # re-execs itself with sudo
corten unmount           # tears it down

Requirements

  • Linux with the 9P kernel module loaded:
    sudo modprobe 9p 9pnet            # for 9P over TCP (trans=tcp, used here)
    sudo modprobe 9pnet_virtio        # additionally, for virtio-9p transports
    
    Check with lsmod | grep 9p. If modprobe 9p fails, your kernel was built without 9P support and you'll need a different kernel (or a kernel module package like linux-modules-extra-$(uname -r) on Debian/Ubuntu).
  • sudo (the mount runs as root).
  • mount from util-linux.
  • Build the binary with --features ninep (the default corten Homebrew bottle already includes it).

Troubleshooting

  • "Mount failed." with empty stderr - the 9P kernel module isn't loaded. Run sudo modprobe 9p 9pnet and retry.
  • "Failed to re-exec corten via sudo" - sudo is not installed. Install it or run corten mount directly as root.
  • "Port 9564 is already in use" - some other process is bound to the 9P server port. Stop it or change NINEP_PORT (compile-time constant).

Configuration

Configuration is stored at ~/.config/corten/config.toml and is created with sane defaults on first run:

[ollama]
base_url = "http://ollama.akinus21.com"
model = "minimax-m2.7:cloud"

[watcher]
enabled = true
watch_dirs = ["~/Documents", "~/Downloads"]
auto_tag_threshold = 0.85

[mount]
mount_point = "/mnt/corten"

Installation

Homebrew (Linux)

brew tap akinus/forgejo https://forge.akinus21.com/akinus/homebrew-akinus21-forge.git
brew install corten

From Source

cargo build --release --features ninep
./target/release/corten init

License

MIT