Skip to content

A new package designed to interpret user descriptions of system maintenance, backup routines, and dotfile management tasks, and convert them into structured commands or step-by-step procedures. It tak

Notifications You must be signed in to change notification settings

chigwell/natus-command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

natus-command

PyPI version License: MIT Downloads LinkedIn

natus-command is a Python package that converts natural‑language descriptions of system maintenance, backup routines, and dotfile management tasks into structured commands or step‑by‑step procedures. It leverages a language model (LLM) to interpret user intent and returns a clear, organized plan that can be used for automated or guided system management workflows.

Features

  • Parses free‑form user text into executable system instructions.
  • Works out‑of‑the‑box with ChatLLM7 (via langchain_llm7).
  • Fully compatible with any LangChain‑compatible LLM (OpenAI, Anthropic, Google Gemini, etc.).
  • Simple API with optional API‑key handling for LLM7 free tier.
  • Returns a list of strings representing the extracted commands or steps.

Installation

pip install natus_command

Quick Start

from natus_command import natus_command

user_input = """
I want to backup my home directory to /mnt/backup daily at 2 am,
and also sync my dotfiles from ~/dotfiles to GitHub.
"""

# Use the default LLM7 (requires an API key either in the environment or passed explicitly)
result = natus_command(user_input)

print(result)
# Example output:
# [
#   "0 2 * * * rsync -a ~/ /mnt/backup/",
#   "git -C ~/dotfiles push origin main"
# ]

Parameters

Parameter Type Description
user_input str The natural‑language description of the task(s) to be processed.
llm Optional[BaseChatModel] A LangChain LLM instance. If omitted, the package creates a ChatLLM7 instance automatically.
api_key Optional[str] API key for LLM7. If not supplied, the function looks for LLM7_API_KEY in the environment.

Using a Custom LLM

You can pass any LangChain‑compatible LLM instead of the default ChatLLM7.

OpenAI

from langchain_openai import ChatOpenAI
from natus_command import natus_command

llm = ChatOpenAI(model="gpt-4o-mini")
response = natus_command(user_input, llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from natus_command import natus_command

llm = ChatAnthropic(model_name="claude-3-haiku-20240307")
response = natus_command(user_input, llm=llm)

Google Gemini

from langchain_google_genai import ChatGoogleGenerativeAI
from natus_command import natus_command

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
response = natus_command(user_input, llm=llm)

API Key & Rate Limits

  • LLM7 free tier provides generous rate limits suitable for most use cases of this package.
  • To obtain a free LLM7 API key, register at https://token.llm7.io/
  • You can provide the key via the environment variable LLM7_API_KEY or directly:
response = natus_command(user_input, api_key="YOUR_LLM7_API_KEY")

If you need higher limits on LLM7, simply use your own paid key.

Contributing & Support

License

This project is licensed under the MIT License.


Happy automating!

About

A new package designed to interpret user descriptions of system maintenance, backup routines, and dotfile management tasks, and convert them into structured commands or step-by-step procedures. It tak

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages