Skip to content

Installation

Alexander Hamilton edited this page Dec 4, 2024 · 2 revisions

Setting up the Principles Framework is straightforward. Follow the steps below to install and configure the framework on your local machine.

Prerequisites

Before installing Principles, ensure that your system meets the following requirements:

  • Node.js: Version 14 or higher
  • npm or Yarn:
    • npm version 6 or higher
    • Yarn version 1.22 or higher
  • OpenAI API Key: Required to utilize OpenAI's GPT models for natural language processing.

Installation Steps

1. Clone the Repository

Begin by cloning the Principles repository from GitHub:

git clone https://github.com/miltonian/principles.git
cd principles

2. Install Dependencies

Install the necessary dependencies using npm or Yarn:

npm install
# or
yarn install

3. Set Up Environment Variables

Create a .env file in the root directory of the project and add your OpenAI API key:

OPEN_AI_TOKEN=your-openai-api-key

Note: Replace your-openai-api-key with your actual OpenAI API key. If you do not have an API key, you can obtain one by signing up on the OpenAI website.

4. Configure Git Ignore

Ensure that your .env file is ignored in version control to protect sensitive information. Verify that your .gitignore includes the following entries:

node_modules/
dist/
.env

This prevents the .env file from being accidentally committed to the repository.

Verification

After completing the installation steps, verify that Principles is set up correctly by running a test command:

npm run generate-agents "I want to optimize my daily schedule to improve productivity."

If the installation was successful, you should see output indicating that agents have been generated and packaged.

Troubleshooting Installation Issues

If you encounter any issues during installation, consider the following steps:

  • Check Node.js and npm/Yarn Versions: Ensure that you have the required versions installed.
  • Verify OpenAI API Key: Double-check that your API key is correctly added to the .env file.
  • Network Issues: Ensure that your internet connection is stable during the cloning and installation process.
  • Dependency Errors: If dependency installation fails, try deleting node_modules and package-lock.json or yarn.lock and reinstalling.

If problems persist, refer to the Troubleshooting section or open an issue on the repository.

Clone this wiki locally