Skip to main content

AI-powered file generation CLI tool

Project description

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 functionality
  • ai_manager.py: Handles AI interactions and prompt management
  • file_manager.py: Manages file operations and tool implementations
  • tool_parser.py: Allows XML use of tools by FileCannon

Methods

AIManager

  • generate_content(prompt: str, examples: List[str], example_contents: List[str]) -> str
  • construct_prompt(user_prompt: str, context: dict) -> str

FileManager

  • list_files(directory: str) -> List[str]
  • read_file(path: str) -> str
  • write_file(path: str, content: str) -> bool
  • validate_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

  1. Environment Variables:

  2. Dependencies:

    • openai
    • anthropic
  3. This project uses ai-agent-toolbox for tool management and XML handling.

Part of the 255labs.xyz toolkit for AI-first development.

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

filecannon-0.1.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

filecannon-0.1.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file filecannon-0.1.5.tar.gz.

File metadata

  • Download URL: filecannon-0.1.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for filecannon-0.1.5.tar.gz
Algorithm Hash digest
SHA256 32ff08f4858d56f6f50e0b746f8cc02ba9889ae29e692e6838fb5a961ccf6a6e
MD5 1e03aaee8ae0a77cc6e4d42234104f65
BLAKE2b-256 595f00bcd0410fd9f89f0a8eb373d4df10ac795f325412f5ac71096bd9ed7526

See more details on using hashes here.

File details

Details for the file filecannon-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: filecannon-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for filecannon-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b71f3d8a8df5f5ffb776d263fa7a0644d5684de4f1e3a44b8b9fc6e8c9eb7f5a
MD5 81a39b8132f5cfb14169340e3cdce126
BLAKE2b-256 0558a9fb0ac73ccd4be1b275d342e961d9380299241290109782bf6f1d5ed9b2

See more details on using hashes here.

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