Skip to content

elilands/termind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 termind

npm version npm downloads License: MIT

Your terminal with long-term memory. Learn from your command patterns, predict your next move, and automate your workflows.

Ever repeated the same complex command sequence because you couldn't remember how you did it last time? Tired of digging through history just to find that one deployment workflow?

termind learns your terminal habits, groups commands into semantic task sequences, and lets you search through your history like it understands what you're trying to do. It even predicts your next command based on context and lets you save workflows as reusable recipes with adjustable parameters.


✨ Features

  • 🧠 Smart Pattern Learning: Automatically detects and learns the workflows you repeat most often.
  • πŸ” Semantic Search: Find "what I did when staging broke" instead of digging through raw history.
  • 🎯 Contextual Predictions: Suggests your next command based on previous sequences and context.
  • πŸ“‹ Task Grouping: Automatically groups related commands into task sessions using semantic clustering.
  • 🎬 Intelligent Macros: Save workflows as recipes with template parameters ([version], [path], etc.) for instant reuse.
  • 🌍 Multi-language Support: English and Spanish locales built-in.
  • ⚑ Blazing Fast: Built with TypeScript, SQLite, and optimized for minimal overhead.

πŸ“¦ Installation

You can run it directly without installation using your favorite package manager:

# Using NPM
npx @elilands/termind recipe list

# Using PNPM
pnpm dlx @elilands/termind recipe list

# Using Yarn
yarn dlx @elilands/termind recipe list

Or install it as a dev dependency in your project:

npm install -D @elilands/termind

πŸš€ Usage

1. View Your Recent Task Recipes

See the task sequences you've performed recently, grouped by semantic similarity:

npx @elilands/termind recipe list

2. Search Your Command History Semantically

Find tasks by natural language queries instead of exact command matching:

npx @elilands/termind recipe search "deploy frontend"
npx @elilands/termind recipe search "what broke staging"

3. Filter by Semantic Tags

Find tasks that share common action tags (build, deploy, test, etc.):

npx @elilands/termind recipe tags deploy
npx @elilands/termind recipe tags build

4. View a Specific Task Recipe

Display the full command sequence for a particular task with exit codes and timing:

npx @elilands/termind recipe show 5

5. View Statistics

See aggregate statistics about your command patterns:

npx @elilands/termind recipe stats

6. Predict the Next Command

Get suggestions for what command you might want to run next:

npx @elilands/termind predict

7. Learn from Your History

Analyze your existing shell history and extract workflows:

npx @elilands/termind learn

πŸ€” How It Works

  1. Command Recording: termind tracks the commands you run and their exit codes.
  2. Semantic Tagging: Each command is automatically tagged with action type (build, deploy, test, vcs, etc.), time of day, and directory.
  3. Task Clustering: Similar command sequences are grouped into tasks using semantic similarity (Jaccard index on command sets + tag overlap).
  4. Pattern Learning: Recurring workflows are detected and suggestions are generated for optimization.
  5. Intelligent Search: Your commands are indexed and searchable by natural language queries, not just raw text matching.

🀝 Contributing

Found a bug or have an idea? PRs welcome!

  1. Clone the repo.
  2. Run npm install.
  3. Make your changes in src/.
  4. Run npm run test to ensure tests pass.
  5. Submit your PR!

πŸ“„ License

MIT License. See LICENSE for details. Built for developers, by developers. 4. Enable Tab autocomplete for your most-used workflows

Predict Next Command

npx @elilands/termind predict

# Or predict contextually
npx @elilands/termind predict "git pull"

Returns the most likely next command with confidence scores.

Get Suggestions

npx @elilands/termind suggest

Analyzes your workflows and suggests:

  • Commands that should be combined into macros
  • Complex workflows that could be automated
  • Potential optimizations based on your patterns

View Statistics

npx @elilands/termind stats

Shows:

  • Total commands tracked
  • Unique patterns found
  • Top recurring patterns

Multiple Language Support

Default language is English, but you can switch to Spanish:

TERMIND_LANG=es termind learn
# or
termind learn --language es

Development

Setup

git clone https://github.com/elilands/termind.git
cd termind
npm install

Build

npm run build

Run in Development Mode

npm run dev

Run Tests

npm test

Lint and Format

npm run lint
npm run format

Architecture

src/
β”œβ”€β”€ cli.ts                 # Main CLI interface
β”œβ”€β”€ index.ts              # Module exports
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ i18n.ts           # Internationalization
β”‚   β”œβ”€β”€ predictor.ts      # Command prediction engine
β”‚   β”œβ”€β”€ learner.ts        # Workflow learning
β”‚   └── recorder.ts       # Command macro recording
└── db/
    └── database.ts       # SQLite database management

How It Works

  1. Command Tracking: Each command you run is added to the local SQLite database
  2. Pattern Detection: Sequences of 3+ commands that repeat are identified as patterns
  3. Prediction: When you're typing, Termind predicts the next command based on your history
  4. Macro Recording: Complex workflows can be recorded and replayed with custom parameters
  5. Optimization: Weekly analysis suggests improvements based on your usage patterns

Data Privacy

All data is stored locally in ~/.termind/history.db. No data is sent to external servers.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Author

@elilands


Built with ❀️ for terminal enthusiasts

About

🧠 Terminal with long-term memory. Learns your command patterns, predicts your next move, and automates your workflows.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors