FileCannon
Introduction
FileCannon is an AI-powered file generation CLI tool that creates new files based on examples and natural language descriptions. It leverages AI models to generate content, making it easy to quickly create files with a structure similar to provided examples.
Installation
pip install filecannon
Then, you can use the filecannon command with the following syntax:
filecannon <prompt> [options]
Arguments:
prompt: Description of the file to generate (required)
Options:
-e, --example: Path to example file(s) (can be used multiple times)-m, --model: Model to use (default: claude-3-5-sonnet-20240620)-o, --output: Output directory (default: current directory)
Example:
filecannon "Create a Python script that calculates fibonacci numbers" -e examples/math_functions.py -o output/
Files
The main custom files in this project are:
filecannon.py: The main script containing the CLI logic and core functionalityai_manager.py: Handles AI interactions and prompt managementfile_manager.py: Manages file operations and tool implementationstool_parser.py: Allows XML use of tools by FileCannon
Methods
AIManager
generate_content(prompt: str, examples: List[str], example_contents: List[str]) -> strconstruct_prompt(user_prompt: str, context: dict) -> str
FileManager
list_files(directory: str) -> List[str]read_file(path: str) -> strwrite_file(path: str, content: str) -> boolvalidate_path(path: str) -> bool
ToolParser
This component allows XML use of tools by FileCannon. The specific methods are not detailed in the specification.
Models
FileCannon supports the following AI models:
- Claude 3.5 Sonnet (default)
- OpenAI models (configurable)
Available CSS styles
This project is a CLI tool and does not include any CSS styles.
Available JS functions
This project is a CLI tool and does not include any JavaScript functions.
Additional notes
-
Environment Variables:
- Set
ANTHROPIC_API_KEYif using Claude models - Set
OPENAI_API_KEYif using OpenAI models - Set
OPENAI_BASE_URLif using OpenAI (defaults to "https://api.openai.com")
- Set
-
Dependencies:
- openai
- anthropic
-
This project uses ai-agent-toolbox for tool management and XML handling.
Part of the 255labs.xyz toolkit for AI-first development.
License
MIT
Release files for filecannon 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| filecannon-0.1.6.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| filecannon-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / filecannon-0.1.6.tar.gz
| Download URL | filecannon-0.1.6.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7466b8f32ec520bbb7c3b1832df59c45d54fd666bcec4d404936dc479945ac18
|
|
BLAKE2b-256 checksum How to use checksums |
ffb1eb1ad2104af3f029735b5852b7ed909f0e34f47bafd236734859ed056181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / filecannon-0.1.6-py3-none-any.whl
| Download URL | filecannon-0.1.6-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
58d07342194dc674d54d153323206d57bf210482e9918562b123c0ad326d4b6b
|
|
BLAKE2b-256 checksum How to use checksums |
16a974b79a8c3a6152176178475945f82837a53929b67fdc4731e09a8c80bb42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|