Keyshade Alpha is launching April 30th 5:00 PM IST
Join our Launch Party
keyshade docs
GithubDiscordReddit
  • 👋What is keyshade?
  • Getting Started
    • Introduction
    • Adding your first secret and variable
    • Installing the CLI
    • Setting up your profile
    • Add keyshade to your project
    • Running your app
  • CLI
    • Introduction
    • Profile
    • Init
    • Workspace
    • Project
    • Environment
    • Run
    • Scan
  • 🥰CONTRIBUTING TO KEYSHADE
    • Summary
    • Design of our code
      • Organization of code
      • API
      • CLI
      • Web
      • Integrations
    • Prerequisites
    • Environment Variables
    • Setting things up
    • Running things locally
      • Running the API
      • Running the Web
      • Running the Platform
      • Running the CLI
      • API Testing
      • Docker Support
  • Internals
    • Architecture of keyshade
    • How the CLI works
Powered by GitBook
On this page
  • The three main configuration files
  • Profile
  • Project configuration
  • Private Key

Was this helpful?

Edit on GitHub
  1. Internals

How the CLI works

The magic behind the CLI tool.

PreviousArchitecture of keyshade

Last updated 10 months ago

Was this helpful?

When developing the CLI, we ensured that we would prioritize ease of use and simplicity. We had the following goals in mind:

  • Secure by design: We wanted to ensure that your secrets (API Keys and project private keys) are safe by default.

  • Easy to interpret and configure: The configuration files that we use to make the CLI run are readable, lightweight and easy to understand.

  • Fast and efficient: We wanted to ensure that the CLI is fast and efficient, so that you can get your work done quickly.

The three main configuration files

When using our CLI, you would need to configure it first.

Profile

This includes creating one or more . A profile is a simple object that stores your API Key and the API base URL (Yes! We do give you the option to configure the base URL of the API).

The following is the TypeScript interface for a profile:

interface ProfileConfig {
  default: string
  [name: string]: {
    apiKey: string
    baseUrl: string
  }
}

All of your profiles are stored under ~/.keyshade/profiles.json. You have the ability to have multiple profiles at once. The default key is used to specify the default profile that should be used when no profile is specified.

With this done, you can easily use any command to modify items on the platform.

Project configuration

interface ProjectRootConfig {
  workspace: string
  project: string
  environment: string
}

Note that, you can only tap into updates for any given trio of project, environment and workspace.

Private Key

Perhaps the most important sensitive data in the entire application, we store the secret in a file named private-keys.json file under the ~/.keyshade directory. This file contains key-value pairs of the project+environment name and the private key.

interface PrivateKeyConfig {
  [projectEnvironment: string]: string
}

If you would like your application to tap into the live updates from our platform, you would need to your project. This command creates a keyshade.json file in your project root. This file contains the following information:

profiles
init