npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fatduckai/cli

v0.6.1

Published

CLI tool for managing FatDuck AI prompts and tools

Downloads

732

Readme

@fatduckai/cli

Command-line interface for managing AI prompts and tools in your FatDuck AI projects.

📦 Installation

Global Installation

# Using npm
npm install -g @fatduckai/cli

# Using bun
bun install -g @fatduckai/cli

# Now you can use the CLI directly
fatduckai add tweet

Local Installation

# Using npm
npm install --save-dev @fatduckai/cli

# Using bun
bun add -d @fatduckai/cli

🛠️ Commands

add <component>

Add a prompt or tool to your project.

fatduckai add tweet              # Add the tweet prompt
fatduckai add btc-price         # Add the Bitcoin price tool
fatduckai add tweet --yes       # Skip confirmation prompt

The command will:

  1. Create the appropriate directory structure (ai/prompts or ai/tools)
  2. Generate a TypeScript file with the component configuration
  3. Show usage instructions

Help

# Show general help
fatduckai --help

# Show help for a specific command
fatduckai add --help

📁 Project Structure

When you add components, they are organized in the following structure:

your-project/
├── ai/
│   ├── prompts/
│   │   └── tweet.ts
│   └── tools/
│       └── btc-price.ts

🧪 Development

Setup

# Clone the repository
git clone https://github.com/yourusername/fatduckai
cd packages/cli

# Install dependencies
bun install

Build

# Build the project
bun run build

Testing

# Run unit tests
bun test

# Run manual test script
bun run test/manual-test.ts

Development Mode

# Run CLI in development mode
bun run dev add tweet

📝 Example Usage

Adding and Using a Prompt

  1. Add the tweet prompt to your project:
fatduckai add tweet
  1. Use the prompt in your code:
import { tweet } from "./ai/prompts/tweet";

// Use the prompt with your AI service
const result = await ai.generate(tweet.template, {
  topic: "AI advancements",
  tone: "professional",
  includeHashtags: true,
  includeEmojis: true,
});

Adding and Using a Tool

  1. Add the Bitcoin price tool:
fatduckai add btc-price
  1. Use the tool in your code:
import { btcPrice } from "./ai/tools/btc-price";

const price = await btcPrice.handler({
  config: {
    currency: "USD",
    precision: 2,
  },
});

🔧 Configuration

The CLI will respect any .fatduckrc or fatduck.config.js file in your project root. Example configuration:

{
  "outputDir": "custom/path",
  "typescript": true
}

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.