Skip to content

juniusfree/stackwise

 
 

Repository files navigation

Stackwise: Explain what you want a function to do, and AI builds it.

Discord Follow Twitter Follow GitHub Repo stars License: MIT

Stackwise is a VS Code extension that automatically writes and imports nodejs functions so that you can write code without context switching.

Usage

Stackwise introduces a straightforward command structure, where you specify a 'brief' for the desired action, along with the inputs and outputs:

stack("brief describing a specific action", {
    in: /* single input or object {} with multiple inputs */,
    out: // same as above, but output
})

This approach streamlines API interactions, reducing the need for intricate coding and extensive API knowledge. Fully typed, and editable within your repo.

Upon saving your command, Stackwise replaces it with a collapsed function with your inputs and an import statement at the top of your file. The generated code resides in the /stacks directory within your project root, ensuring clean and maintainable codebase.

Special Note for NextJS Developers

NextJS developers can leverage Stackwise for server actions, making API integrations even smoother. Here’s an example demonstrating the use of Stackwise in a NextJS environment:

example image

Current Integrations

Stackwise currently integrates with three APIs:

  • Replicate
  • OpenAI
  • Pinecone

Contributions to improve these or add new integrations are welcome. If you're interested in expanding Stackwise's capabilities, feel free to submit a pull request or contact us (join the Discord or contact@stackwise.ai) for collaboration.

Getting Started

Prerequisites:

  • Typescript project
  • openai api key
  • pinecone api key

To start using Stackwise, follow these steps:

  1. Clone the Stackwise repository:
git clone https://github.com/stackwiseai/stackwise.git
  1. cd stackwise
  2. npm install
  3. copy the launch.json.example into launch.json and fill these environment variables:
  • PINECONE_API_KEY
  • PINECONE_ENVIRONMENT=PINECONE_ENVIRONMENT
  • OPENAI_API_KEY=OPENAI_API_KEY
  1. Click Run and Debug -> Click on the play button "Run Extension"
  2. Open your typescript project. In your typescript project, type:
const prompt = "What's the capital of the United States ?"
result = await stack(
    "Ask a question to GPT-4",
    {
        in: prompt
        output: "Washington D.C"
    }
)
  1. Save your file. The function should collapse into something like this. const prompt = "What's the capital of the United States ?"
const result = await askGPT4(prompt)
  1. You can cmd + click (ctrl + click on windows) on the function to see the code of the function.
  2. If you don't like the code, edit it.

Roadmap

Our future developments include:

  • Interactive stack modification: Chat with your stack to refine and improve it.

  • Dynamic input chains: Link multiple stacks to each other using dynamic inputs. Currently only static briefs work.

  • Expand integrations: Continually adding more APIs based on community feedback. Let us know what you want to see next!

  • API insights: See what APIs you're calling most and how what you're using them for.

  • Non-collapsible stacks: Edit your stacks continuously without automatic collapsing. If something with the api changes, it will automatically heal to work.

Join The Community

Discord Follow

We welcome contributions, feedback, and suggestions to further enhance Stackwise.

We want to make API integration easy, without the hassle of reading documentation or ever leaving your IDE. If you made it here you're at the very least intruiged and we'd love to have you :)


This project is licensed under the MIT License.

About

Plug and play functions within your workflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.2%
  • JavaScript 1.8%