Skip to main content

Linux-first command snippet manager for markdown notes

Project description

OpIndex

OpIndex is a Linux-first command memory tool for markdown notes. It parses reusable command blocks from your notes, lets you search them from a launcher, and copies the selected command to the clipboard.

The current UI is optimized for rofi on X11, but the note format and CLI are useful independently of the launcher.

What it does

  • searches reusable commands from markdown files
  • organizes sources into named workspaces
  • supports quick workspace switching from a launcher
  • shows source-document context while browsing
  • lints notes against the OpIndex authoring standard
  • copies selected commands to the clipboard

Platform

OpIndex currently targets Linux. It expects one of:

  • rofi for the interactive launcher flow
  • xclip, xsel, or wl-copy for clipboard access

Installation

System dependencies

Debian or Ubuntu:

sudo apt install rofi xclip

Wayland clipboard support:

sudo apt install wl-clipboard

Python package

The intended PyPI distribution name is opindex.

pipx install opindex

This installs the opindex command.

For local development:

pipx install .

Quick start

Create a config:

opindex --create-config

Run the selector in the default workspace:

opindex

Open the workspace picker first:

opindex --workspace-menu

Search a specific workspace:

opindex --workspace oscp

Search all workspaces:

opindex --all

Browse by workspace, then document:

opindex --browse

Configuration

The config file lives at:

~/.config/opindex/config.yaml

Example:

default_workspace: oscp

workspaces:
  oscp:
    directories:
      - "~/notes/OSCP-Methodology"
    files: []
    recursive: true
    file_patterns:
      - "*.md"
      - "*.markdown"

  cheatsheets:
    directories:
      - "~/notes/cheatsheets"
    files: []
    recursive: true
    file_patterns:
      - "*.md"
      - "*.markdown"

rofi:
  args: []
  use_markup: true
  max_lines: 15
  prompt: "Commands"
  window_width: 60
  element_height: 2

cache:
  enabled: true
  directory: null
  auto_cleanup: true

substitute_variables: false
variables: {}

Markdown format

Minimal parseable format:

# Azure CLI

## Login with device code
```bash
az login --use-device-code
```

OpIndex parses:

  • # as the category
  • ## as the searchable task heading
  • fenced code blocks as command content

Supported command block languages:

  • empty language
  • bash
  • sh
  • shell
  • powershell
  • ps1
  • cmd
  • bat
  • batch

For the stricter durable-note format, see:

Linting

Lint a specific note:

opindex --lint-files path/to/file.md

Lint the selected workspace sources:

opindex --lint-files

CLI

Common commands:

opindex --help
opindex --list-workspaces
opindex --list-files
opindex --list-commands
opindex --clear-cache
opindex --config-path

Development

Run tests:

python3 -m pytest tests/

Run the parser against a file:

python3 -m cmd_manager.parser test_data/sample.md

Lint a note during development:

python3 opindex --lint-files test_data/sample.md

Publishing

The package is prepared for Trusted Publishing from GitHub Actions. See:

Releases publish to PyPI from pushed tags in the form v<semver>.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opindex-0.1.2.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opindex-0.1.2-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file opindex-0.1.2.tar.gz.

File metadata

  • Download URL: opindex-0.1.2.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opindex-0.1.2.tar.gz
Algorithm Hash digest
SHA256 60495e2819bfeeac1ba104ee1d5aaa49314e46fe9b729ef3a83cc818dcf2528e
MD5 ea67b776d0bf19cae257bc674b1d248c
BLAKE2b-256 0195af73874269795cf9ed3dbee253d93ca8ab3f31d3ef994bb48f0e2d11ed53

See more details on using hashes here.

Provenance

The following attestation bundles were made for opindex-0.1.2.tar.gz:

Publisher: publish-pypi.yml on CameronCandau/OpIndex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opindex-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: opindex-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opindex-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b557a61023b9363f6ee2122dd62bfcdbc30877b138b191c88830da4399f11d22
MD5 aa47173110f3875d5577fe718a686778
BLAKE2b-256 340aa1cbc5c238c76976c1be485225093296f3a75ed292eb0e971ce9e2249079

See more details on using hashes here.

Provenance

The following attestation bundles were made for opindex-0.1.2-py3-none-any.whl:

Publisher: publish-pypi.yml on CameronCandau/OpIndex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page