Skip to content

bouvet/opti-cli

Repository files navigation

Team Opti CLI Tool

A collection of CLI commands to simplify workflow at Team Opti, working with Optimizely.

Features

  • Optimized Commands: Predefined commands tailored for Team Optimizely workflows.
  • Test Environment: A testenv folder (ignored by version control) where you can replicate an Optimizely environment to test the tool safely.
  • Extensible: Built with Commander.js, making it easy to add and customize commands.

Getting Started

Prerequisites

Some scripts require dotnet to run:

Installation

Clone the repository and install dependencies:

git clone git@github.com:bouvet/opti-cli.git
cd opti-cli
npm install
npm run cli:install

Usage

In terminal, run opti followed by command.

Commands

Command Description Options
opti db Configure project's connection string, create docker-compose.yml, and import .bacpac files. -p, --port <port>: Specify the port for the database (default 1433:1433).
-n, --name <name>: Specify the name of the database container (default sqledge-<port>).
-k, --kill: Kill the entire container stack and related database.
opti db up Start the database container stack in detached mode using docker compose up. N/A
opti db down Stop the database container stack using docker compose down. N/A
opti db import Import a .bacpac file, destroying the existing database and re-importing it. N/A
opti sqlpackage Install sqlpackage with dotnet cli and add it to path --uninstall: Uninstalls sqlpackage
opti watch Starts dotnet watch with the ability to choose which launch profile to run. N/A

For Developers

Global quit()

To exit excecution early, use the global quit() function. This is the same as using process.exit.

Adding a command

Adding a command can be done with this snippet which generates a new one from a template.

npm run commands:add <name of command>

Known Errors When Importing Database

Could not allocate a new page for database

*** Could not allocate a new page for database 'arbi02mstr6nz45prep' because the 'PRIMARY' filegroup is full due to lack of storage space or database files reaching the maximum allowed size. Note that UNLIMITED files are still limited to 16TB. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

This error occurs when docker does not have enough memory allocated. Can be fixed by going into docker settings and increasing the limit. The disk usage limit is the value that needs to be increased

Docker -> settings -> resources -> Disk usage limit

About

CLI tools for team optimizely workflow

Resources

Stars

1 star

Watchers

3 watching

Forks

Packages

 
 
 

Contributors