### Start HTTP Server with Python Source: https://www.commands.dev/workflows/start_server This command utilizes the built-in http.server module to serve files from the current directory. It requires Python 3 to be installed on the system and accepts an optional port number. ```bash python3 -m http.server [port] -d . ``` -------------------------------- ### CLI Command Example Source: https://www.commands.dev/workflows/resources_create_s3 Example of how to add an Amazon S3 resource using the Meroxa CLI. ```APIDOC ## CLI Command ### Description This command demonstrates how to add an Amazon S3 resource to the Meroxa Platform using the `meroxa` CLI. ### Command ```bash meroxa resources create --type s3 --url "s3://:@/" ``` ### Parameters - **resource_name** (string) - Required - The name for the new S3 resource. - **aws_access_key** (string) - Required - Your AWS access key ID. - **aws_access_secret** (string) - Required - Your AWS secret access key. - **aws_region** (string) - Required - The AWS region where your S3 bucket is located. - **aws_s3_bucket** (string) - Required - The name of your S3 bucket. ### Example Usage ```bash meroxa resources create my-s3-resource --type s3 --url "s3://AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLE@us-east-1/my-example-bucket" ``` ``` -------------------------------- ### Install Laravel Nova with Composer Source: https://www.commands.dev/workflows/laravel_install_nova This command installs Laravel Nova by first configuring the Nova repository in composer.json, then requiring the laravel/nova package, and finally updating the dependencies. ```bash composer config repositories.nova '{"type": "composer", "url": "https://nova.laravel.com"}' --file composer.json && composer require laravel/nova && composer update --prefer-dist ``` -------------------------------- ### Install Laravel Installer via Composer Source: https://www.commands.dev/workflows/laravel_installer This command installs the Laravel installer globally on your system using the Composer package manager. It requires PHP and Composer to be installed and available in your system's PATH. ```bash composer global require laravel/installer ``` -------------------------------- ### Install Yarn Package from Git Repository Source: https://www.commands.dev/workflows/install_package_in_yarn_from_a_git_repository This command demonstrates how to add a package directly from a Git repository URL using Yarn. It specifies the repository URL and an optional branch name. This is useful for installing packages that are not yet published to a registry or for using specific versions from a development branch. ```bash yarn add git_remote_url#main ``` -------------------------------- ### Install specific Homebrew formula version Source: https://www.commands.dev/workflows/install_a_specific_version_of_a_homebrew_formula This command installs a specific version of a Homebrew formula. Users should first identify the desired version using 'brew search' before executing the install command. ```bash brew install formula_name@version_name ``` -------------------------------- ### Run Turborepo Pipeline with Package Filter Source: https://www.commands.dev/workflows/run-filtered-pipeline This command executes a Turborepo pipeline across all packages in the repository. It's useful for running build, test, or start scripts in parallel for the entire monorepo. Ensure Turborepo is installed and configured in your project. ```bash npx turbo run start --filter=* ``` -------------------------------- ### Start Android App via ADB Shell Command Source: https://www.commands.dev/workflows/start_an_android_application_using_android_adb_tools This command uses ADB (Android Debug Bridge) to send an intent that starts a specified Android application. It requires the package name and activity name of the application to be known. This is useful for automating app launches or testing. ```bash adb shell am start -n com.my.app.package/com.my.app.package.MainActivity ``` -------------------------------- ### Create Laravel App with Composer Source: https://www.commands.dev/workflows/laravel_create_new_project This command uses Composer to create a new Laravel application named 'example-app'. It downloads the latest stable version of Laravel and sets up the necessary project structure and dependencies. Ensure Composer is installed and accessible in your PATH. ```bash composer create-project laravel/laravel example-app ``` -------------------------------- ### Create Empty SQLite Database using CLI Source: https://www.commands.dev/workflows/create_an_empty_sqlite_db This command initializes a new SQLite database file at the specified path by executing the VACUUM command. It requires the sqlite3 command-line tool to be installed on the system. ```bash sqlite3 {db_filepath} "VACUUM;" ``` -------------------------------- ### Reinstall Homebrew Formulae and Casks (Shell) Source: https://www.commands.dev/workflows/reinstall_all_formula This command reinitializes all installed Homebrew formulae and casks. It first lists all installed items using 'brew list -1' and then pipes the output to 'xargs brew reinstall' to perform the reinstallation. This is useful for ensuring all packages are up-to-date or resolving potential issues. ```shell brew list -1 | xargs brew reinstall ``` -------------------------------- ### Install Yarn Dependencies Reproducibly (Shell) Source: https://www.commands.dev/workflows/yarn_install_with_reproducible_dependencies Installs yarn dependencies using the `--frozen-lockfile` flag to ensure reproducible builds. This command prevents yarn from updating the lockfile, making it ideal for CI environments where consistent dependency versions are crucial. ```shell yarn install --frozen-lockfile ``` -------------------------------- ### Retrieve installed npm package version Source: https://www.commands.dev/workflows/find_version_of_an_installed_npm_package This command displays the version of a specific npm package installed in the current project. If no package name is provided, it lists all installed packages and their dependencies. ```bash npm list package_name ``` -------------------------------- ### Shell For-Loop Example Source: https://www.commands.dev/categories/shell Demonstrates a basic for loop in shell scripting, which iterates over a sequence of items. A common use case is processing files listed by a command like 'ls'. ```shell for i in $(ls); do echo "item: $i" done ``` -------------------------------- ### Create NativeScript App Source: https://www.commands.dev/workflows/create_nativecript_app Interactively creates a new NativeScript app based on a predefined template. This command is essential for starting any new NativeScript project. ```bash ns create app_name ``` -------------------------------- ### Uninstall Homebrew package with dependencies Source: https://www.commands.dev/workflows/uninstall_a_homebrew_package_and_all_of_its_dependencies This command installs the rmtree tap and executes it to remove a specified package and its dependencies. It requires Homebrew to be installed on the system. ```shell brew tap beeftornado/rmtree brew rmtree package_name ``` -------------------------------- ### Shell While-Loop Example Source: https://www.commands.dev/categories/shell Illustrates the usage of a while loop in shell scripting, which repeatedly executes a block of code as long as a specified condition remains true. This is analogous to while loops in other programming languages. ```shell count=0 while [ $count -lt 5 ]; do echo "Count: $count" count=$((count + 1)) done ``` -------------------------------- ### Sort Kubernetes Pods by Age (startTime) Source: https://www.commands.dev/workflows/sort_kubernetes_pods_by_age This command sorts all Kubernetes pods by the pod's start time. To sort by the pod's creation time, specify `.metadata.creationTimestamp` as the value for `--sort-by`. ```bash kubectl get po --sort-by=.status.startTime ``` -------------------------------- ### Show Media File Streams and Format in JSON using ffprobe Source: https://www.commands.dev/workflows/ffprobe_streams_json This command uses ffprobe to parse a media file and output its stream and format information in JSON. It requires ffprobe to be installed and accessible in the system's PATH. The input is a media file path, and the output is a JSON string containing detailed media metadata. ```bash ffprobe -i media_file_path -show_streams -show_format -print_format json ``` -------------------------------- ### Run Cypress Headless With Mobile Viewport (CLI) Source: https://www.commands.dev/workflows/run-cypress-mobile-viewport This command executes Cypress tests in headless mode, simulating a mobile device's viewport dimensions. It's useful for testing responsive designs without a graphical interface. Ensure Cypress is installed in your project. ```bash npx cypress run --config viewportWidth=375,viewportHeight=667 ``` -------------------------------- ### Start Bash Shell in Docker Container (Bash) Source: https://www.commands.dev/workflows/start_a_bash_shell_within_a_docker_container This command initiates an interactive Bash subshell within a specified Docker container. It requires the container name as an argument and is useful for debugging or executing commands directly inside the container's environment. The `-it` flags ensure an interactive pseudo-TTY is allocated. ```Bash docker exec -it container_name bash ``` -------------------------------- ### List global NPM packages Source: https://www.commands.dev/workflows/list_all_globally_installed_npm_packages This command lists all globally installed NPM packages. The --depth=0 flag is used to prevent the output from including the dependency tree of each package, providing a concise list. ```bash npm list -g --depth=0 ``` -------------------------------- ### GET /commands/array/get Source: https://www.commands.dev/workflows/array_get_value Retrieves a specific value from an array by its index and outputs it to the standard output. ```APIDOC ## GET /commands/array/get ### Description Retrieves a value from a specified array at a given index and prints the result to stdout. ### Method GET ### Endpoint /commands/array/get ### Parameters #### Query Parameters - **array_name** (string) - Required - The name of the array variable. - **index** (integer) - Required - The zero-based index of the element to retrieve. ### Request Example GET /commands/array/get?array_name=my_array&index=0 ### Response #### Success Response (200) - **value** (string) - The value stored at the specified index. #### Response Example { "value": "element_value" } ``` -------------------------------- ### Check Symfony local requirements Source: https://www.commands.dev/workflows/symfony_check_requirements This command executes a diagnostic check on the local environment to ensure all Symfony dependencies and system requirements are met. It is essential for troubleshooting setup issues before running a project. ```bash symfony check:requirements ``` -------------------------------- ### Stream Kubernetes Pod Logs Source: https://www.commands.dev/workflows/show_a_continuous_stream_of_kubernetes_logs This command streams logs from a specified Kubernetes pod in real-time. It requires the kubectl CLI tool to be installed and configured with access to the target cluster. ```bash kubectl logs -f pod_id ``` -------------------------------- ### Clear Android Logcat Buffer using ADB Source: https://www.commands.dev/workflows/clear_the_android_logcat_buffer This command clears the Android logcat buffer. It is useful for starting with a clean slate when debugging. This command requires the Android Debug Bridge (ADB) to be installed and the device to be connected. ```bash adb logcat -c ``` -------------------------------- ### Run a single Playwright test file Source: https://www.commands.dev/workflows/run-a-single-test-file Executes a specific test file using the Playwright test runner. This command requires Node.js and Playwright to be installed in the project environment. ```bash npx playwright test pathToFile ``` -------------------------------- ### List Laravel Application Events and Listeners (PHP) Source: https://www.commands.dev/workflows/laravel_events_list This command lists all the events dispatched by your Laravel application along with their registered listeners. It's useful for understanding event flow and debugging. No external dependencies are required beyond a standard Laravel installation. ```php php artisan event:list ``` -------------------------------- ### Reinstall Homebrew Formula using Brew Command Source: https://www.commands.dev/workflows/reinstall_formula This command reinitializes a specified Homebrew formula, ensuring you have the latest version and resolving potential issues. It requires the 'brew' command-line tool to be installed and configured. ```bash brew reinstall formula_name ``` -------------------------------- ### Run Playwright Test Project Source: https://www.commands.dev/workflows/run-a-single-project Executes Playwright tests filtered by a specific project name. This command requires the Playwright package to be installed in the environment. ```bash npx playwright test --project=projectName ``` -------------------------------- ### Run Turborepo Pipeline with npx Source: https://www.commands.dev/workflows/run-pipeline This command executes a specified pipeline within a Turborepo project. It's a common task for managing monorepos and ensuring consistent build and development processes across multiple packages. Ensure Turborepo is installed and configured in your project. ```bash npx turbo run start ``` -------------------------------- ### Run Playwright tests in specific browsers Source: https://www.commands.dev/workflows/run-test-in-a-specific-browser Executes the Playwright test suite across all configured browsers. This command requires Playwright to be installed in the project environment. ```bash npx playwright test --browser=all ``` -------------------------------- ### Run NativeScript Application on Device Source: https://www.commands.dev/workflows/run_project_on_device Executes a specified NativeScript application on a connected Android or iOS device. Requires the NativeScript CLI to be installed and a device to be properly connected. ```bash ns run application_id ``` -------------------------------- ### Compare Files in VS Code Source: https://www.commands.dev/workflows/compare_two_files_in_vs_code Compares two specified files using the VS Code command-line interface. This command opens a diff view within VS Code, highlighting the differences between file1 and file2. Ensure VS Code is installed and its command-line tools are accessible in your PATH. ```bash code -d file1 file2 ``` -------------------------------- ### Reinstall NPM dependencies Source: https://www.commands.dev/workflows/reinstall_all_npm_dependencies This command removes the local node_modules directory and triggers a fresh npm install. It is useful for resolving corrupted dependency issues or updating packages. ```bash rm -rf node_modules && npm install ``` -------------------------------- ### Dump SQLite schema to file Source: https://www.commands.dev/workflows/dump_sqlite_schema_into_a_sql_file This command uses the sqlite3 CLI tool to extract the schema definition from a database file and redirect the output to a specified .sql file. It requires the sqlite3 utility to be installed on the system. ```bash sqlite3 db_filepath .schema > schema.sql ``` -------------------------------- ### Generate Playwright tests using Codegen Source: https://www.commands.dev/workflows/auto-generate-tests-with-codegen This command launches the Playwright Codegen tool, which records user interactions in a browser and generates corresponding test code. It requires Node.js and the Playwright package to be installed in the project environment. ```bash npx playwright codegen playwright.dev ``` -------------------------------- ### Run Playwright test by title Source: https://www.commands.dev/workflows/run-test-with-title Executes a specific Playwright test matching the provided title string using the --g (grep) flag. This command requires Playwright to be installed in the project environment. ```bash npx playwright test --g "testTitle" ``` -------------------------------- ### Update NPM Globally Source: https://www.commands.dev/workflows/update_npm_to_the_latest_version This command updates the Node Package Manager to the latest available version on the system. It requires global permissions and should be run in a terminal environment where Node.js is installed. ```bash npm update -g npm ``` -------------------------------- ### Upgrade Homebrew Casks Source: https://www.commands.dev/workflows/upgrade_all_installed_homebrew_casks Upgrades all applications installed via Homebrew Cask. This command will not update casks without versioning or those with built-in upgrade mechanisms. Append `--greedy` to reinstall all casks. ```shell brew upgrade --cask ``` -------------------------------- ### Convert Certificate from DER to PEM using OpenSSL Source: https://www.commands.dev/workflows/convert_der_to_pem This command converts a digital certificate from DER (binary encoding) format to PEM (base64 encoded) format. It is useful for compatibility with various systems and tools that expect PEM-formatted certificates. Requires OpenSSL to be installed. ```bash openssl x509 -inform der -outform pem -in in_cert.der -out out_cert.pem ``` -------------------------------- ### Run Bash Command in Kubernetes Pod (kubectl) Source: https://www.commands.dev/workflows/run_a_bash_command_within_a_kubernetes_pod This command executes a Bash command within a specified Kubernetes pod and namespace. The `--` separates kubectl arguments from the command to be run inside the container. Ensure you have kubectl installed and configured to access your Kubernetes cluster. ```bash kubectl exec -it --namespace=tools pod_name -- bash -c "bash_command" ``` -------------------------------- ### Encrypt Laravel Environment File (PHP) Source: https://www.commands.dev/workflows/laravel_encrypt This command encrypts your Laravel .env file, providing a layer of security for your application's sensitive credentials. It is part of the Laravel ecosystem and requires PHP to be installed. ```bash php artisan env:encrypt ``` -------------------------------- ### Decrypt Laravel Environment File Source: https://www.commands.dev/workflows/laravel_decrypt_environment_file_with_key This command decrypts an encrypted Laravel environment file using the provided decryption key. It requires the Laravel framework and the artisan CLI tool to be installed in the project environment. ```bash php artisan env:decrypt --key=decrypt_key ``` -------------------------------- ### Pull File from Android Device using ADB Source: https://www.commands.dev/workflows/pull_file_from_android_device This command utilizes the Android Debug Bridge (adb) to copy a file from a specified path on an Android device to a local file path on your computer. Ensure ADB is installed and configured, and the Android device is connected and authorized. ```bash adb pull android_file_path local_file_path ``` -------------------------------- ### Find Unused NPM Packages with depcheck Source: https://www.commands.dev/workflows/find_unused_npm_packages_in_package_json This command utilizes depcheck to scan your package.json file and identify any npm packages that are installed but not currently being used in your project. This helps in maintaining a clean and efficient dependency list. ```bash npx depcheck ``` -------------------------------- ### Pin Homebrew Formula to Current Version (Shell) Source: https://www.commands.dev/workflows/pin_homebrew_formula This command pins a specified Homebrew formula to its currently installed version. Once pinned, the formula will not be updated when you run 'brew upgrade'. This is useful for maintaining stable environments or when a specific version of a tool is required. The command takes the formula name as an argument. ```shell brew pin formula_name ``` -------------------------------- ### Initialize Nx Workspace for React Source: https://www.commands.dev/workflows/create-nx-workspace-react Uses the npx utility to execute the latest create-nx-workspace package. This command sets up a new project structure with the React preset applied. ```bash npx create-nx-workspace@latest name --preset=react ``` -------------------------------- ### Create Nx Workspace Source: https://www.commands.dev/workflows/create-nx-workspace-default This command initializes a new Nx workspace with the latest version of Nx. It requires a name for the workspace and is executed via npx. ```bash npx create-nx-workspace@latest name ``` -------------------------------- ### Search Committed Files with Git Grep Source: https://www.commands.dev/workflows/search_committed_files This command searches for a specified pattern among all committed files across all branches in a Git repository. It leverages `git grep` to find the pattern and `git rev-list --all` to get a list of all commit hashes. ```bash git grep pattern $(git rev-list --all) ``` -------------------------------- ### Remove Password from Private RSA Key (OpenSSL) Source: https://www.commands.dev/workflows/remove_passwd_from_rsa_key This command uses OpenSSL to decrypt a password-protected private RSA key and save it to a new file without a password. It requires the input private key file (`in.key`) and specifies the output file (`out.key`). Ensure you have OpenSSL installed and the correct file paths. ```bash openssl rsa -in in.key -out out.key ``` -------------------------------- ### Create Postgres Resource via Meroxa CLI Source: https://www.commands.dev/workflows/resources_create_postgres_with_logical_replication This command registers a new Postgres resource in the Meroxa platform. It requires a connection string containing the username, password, host, port, and database name, and includes a metadata flag to enable logical replication. ```bash meroxa resources create resource_name --type postgres --url "postgres://pg_username:pg_password@pg_url:5432/pg_database_name" --metadata '{"logical_replication":"true"}' ``` -------------------------------- ### Get Array Element Count in Shell Source: https://www.commands.dev/workflows/array_get_size This command retrieves the number of elements present in a given array within a shell environment. It's useful for scripting and automation tasks where array size is a critical factor. The output is printed directly to standard output. ```shell echo ${#array_name[@]} ``` -------------------------------- ### Open File or Directory in IntelliJ IDEA Source: https://www.commands.dev/workflows/open_a_file_or_directory_in_intellij_idea_workflow This command opens the specified file or directory in an existing or new instance of IntelliJ IDEA. It requires the IntelliJ command-line launcher to be configured in your system PATH. ```bash idea file_or_directory ``` -------------------------------- ### Create MSSQL Resource via Meroxa CLI Source: https://www.commands.dev/workflows/resources_create_sqlserver This command registers a new SQL Server resource in the Meroxa platform. It requires a unique resource name and a connection string formatted with the username, password, host, port, and database name. ```bash meroxa resources create resource_name --type sqlserver --url "sqlserver://mssql_username:mssql_password@mssql_url:1433/mssql_database_name" ``` -------------------------------- ### Create a PostgreSQL database from a template Source: https://www.commands.dev/workflows/create_a_copy_of_a_postgre_sql_database This command creates a new PostgreSQL database using an existing database as a template. It requires specifying the owner name, the source template database, and the name of the new database. ```shell createdb -O owner_name -T original_db new_db ``` -------------------------------- ### Create MongoDB Resource via Meroxa CLI Source: https://www.commands.dev/workflows/resources_create_mongodb This command registers a new MongoDB resource in the Meroxa platform. It requires a unique resource name and a connection string formatted with the database credentials and host details. ```bash meroxa resources create resource_name --type mongodb -u "mongodb://mongodb_username:mongodb_password@mongodb_url:27017" ``` -------------------------------- ### List iTunes Connect Apps with NativeScript CLI Source: https://www.commands.dev/workflows/list_applications_records_in_itunes_connect This command lists all application records in iTunes Connect, including the name, version, and bundle ID for each application. It requires your Apple ID and password as authentication. ```bash ns appstore apple_id password ``` -------------------------------- ### Import MySQL Dump with Progress Bar (Shell) Source: https://www.commands.dev/workflows/import_my_sql_dump_with_progress_bar This command imports a MySQL dump file into a specified MySQL server database. It uses the 'pv' utility to display a progress bar, showing the transfer speed and time remaining. The command requires the username, database name, and the path to the mysqldump file as input. ```shell pv mysql_dump_path | mysql -u username -p database_name ``` -------------------------------- ### Create Next.JS App with npm Source: https://www.commands.dev/workflows/create_next_app This command uses npx to create a new Next.JS application named 'my-app' and specifies npm as the package manager. ```bash npx create-next-app my-app --use-npm ``` -------------------------------- ### POST /ns/build Source: https://www.commands.dev/workflows/build_the_project Builds the NativeScript project for a specified target platform. ```APIDOC ## POST /ns/build ### Description Builds your NativeScript project for Android or iOS and produces an application package that you can manually deploy on a device or native emulator. ### Method POST ### Endpoint /ns/build ### Parameters #### Query Parameters - **platform** (string) - Required - The target platform to build for (e.g., 'android' or 'ios'). ### Request Example { "platform": "android" } ### Response #### Success Response (200) - **status** (string) - Indicates the build process completion status. - **package_path** (string) - The file path to the generated application package. #### Response Example { "status": "success", "package_path": "/build/outputs/apk/debug/app-debug.apk" } ``` -------------------------------- ### Create Amazon Redshift Resource via Meroxa CLI Source: https://www.commands.dev/workflows/resources_create_redshift This command registers a new Amazon Redshift resource in the Meroxa platform. It requires the resource name, type, and a connection string containing the username, password, host URL, port, and database name. ```bash meroxa resources create resource_name --type redshift --url "redshift://redshift_username:redshift_password@redshift_url:5439/redshift_db_name" ``` -------------------------------- ### Shell While-Loop Syntax Source: https://www.commands.dev/workflows/shell_while_loop Demonstrates the basic syntax for a while loop in the shell environment. This loop continues to execute a command as long as a specified condition remains true. It requires a condition to be evaluated and a command to be executed within the loop. ```shell while condition do command done ``` -------------------------------- ### Generate Nx Library Source: https://www.commands.dev/workflows/generate-library This command uses the Nx CLI to generate a new library within an existing workspace. It requires the framework package to be specified and accepts a name parameter to define the library's identity. ```bash npx nx g @nrwl/framework:library --name=name ``` -------------------------------- ### Open file at specific line in IntelliJ IDEA Source: https://www.commands.dev/workflows/open_a_file_on_a_specific_line_in_intellij_idea_workflow This command utilizes the IntelliJ IDEA command line launcher to open a target file and navigate the cursor to a specified line number. It requires the 'idea' command to be available in your system path. ```bash idea --line 1 file ``` -------------------------------- ### Clone GitHub Organization Repositories using Curl and Git Source: https://www.commands.dev/workflows/clone_all_repos_in_org This command uses `curl` to interact with the GitHub API, retrieves clone URLs for all repositories in a given organization, and then uses `xargs` and `git clone` to clone each repository locally. It requires a GitHub authentication token and specifies the organization and page size for the API request. The output is limited to 100 repositories per page. ```shell curl -s -H "Authorization: token auth_token" "https://api.github.com/orgs/facebook/repos?page=1&per_page=100" | jq -r ".[].clone_url" | xargs -L1 git clone ``` -------------------------------- ### Generate New Library Source: https://www.commands.dev/workflows/generate-library This command generates a new library in your existing Nx workspace. ```APIDOC ## Generate a new library in your Nx workspace ### Description This command generates a new library in your existing Nx workspace. ### Method N/A (CLI Command) ### Endpoint N/A (CLI Command) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Command `npx nx g @nrwl/framework:library --name=name` ### Tags nx ### Authored by mandarini ### Notes By Warp, the intelligent terminal with AI and your dev team's knowledge built-in. Download Now ``` -------------------------------- ### Import SQL File into MySQL Source: https://www.commands.dev/workflows/import_a_sql_file_into_a_my_sql_server Imports an exported SQL dump into a MySQL server using the mysql command-line client. Requires username, database name, and the path to the SQL file. ```bash mysql -u username -p database_name < sql_filepath ``` -------------------------------- ### Dump MySQL Database to File (Shell) Source: https://www.commands.dev/workflows/dump_a_my_sql_database_into_a_file This command dumps a specified MySQL database, including its data, into a SQL file. It requires the username, database name, and optionally a filename for the output. The command uses standard mysqldump utility. ```shell mysqldump -u user_name -p db_name > db_backup.sql ``` -------------------------------- ### Create Amazon S3 Resource in Meroxa Source: https://www.commands.dev/workflows/resources_create_s3 This command registers an S3 bucket as a resource in the Meroxa platform. It requires the resource name, access credentials, region, and bucket name to be formatted into a specific S3 URL string. ```bash meroxa resources create resource_name --type s3 --url "s3://aws_access_key:aws_access_secret@aws_region/aws_s3_bucket" ``` -------------------------------- ### Generate Turborepo Dependency Graph Source: https://www.commands.dev/workflows/create-graph Executes the Turborepo CLI to generate a visual representation of the project's dependency graph. This command requires Node.js and an existing Turborepo configuration. ```bash npx turbo run start --graph ``` -------------------------------- ### Redirect Command Output to File (Shell) Source: https://www.commands.dev/workflows/redirect_output_of_command_to_a_file_by_appending This snippet demonstrates how to redirect the output of a command to a file. If the file does not exist, it will be created. If it exists, the output will be appended to the end of the file. This is a common shell operation. ```shell command >> file ``` -------------------------------- ### Find Files and Execute Command (Shell) Source: https://www.commands.dev/categories/shell Searches for files of specified types within a directory structure and executes a given command on each found file. This is useful for batch processing or applying an operation to a set of files. ```shell find . -type f -name "*.txt" -exec grep "pattern" {} \; ``` -------------------------------- ### Import SQL dump into PostgreSQL database Source: https://www.commands.dev/workflows/import_sql_dump_into_a_postgre_sql_database This command uses the psql utility to pipe a SQL dump file into a specified PostgreSQL database. The database must exist prior to running this command. ```bash psql database_name < database_dump ``` -------------------------------- ### Loop through array and run command (Shell) Source: https://www.commands.dev/workflows/array_loop_through This snippet demonstrates how to iterate over an array in shell scripting and execute a specified command for each element. It's useful for batch processing array elements. Ensure that 'array_name' and 'command' are correctly defined before execution. ```shell for i in ${array_name[@]}; do command; done ``` -------------------------------- ### Convert PEM Certificate to PKCS#12 using openssl Source: https://www.commands.dev/workflows/convert_pem_to_pkcs12 This command converts an SSL certificate and its private key from PEM format to a PKCS#12 container. It requires the certificate file, private key file, and optionally a CA certificate file. The output is a .pfx file. ```bash openssl pkcs12 -export -out out_cert.pfx -in in_cert.pem -inkey in_private.key -certfile cacert.pem ``` -------------------------------- ### Print nth Line of File using sed Source: https://www.commands.dev/workflows/print_the_nth_line_of_a_file This command uses `sed` to efficiently print the nth line of a given file. It leverages `NUMq` to quit immediately after the desired line is found, making it faster than other methods. The inputs are the line number and the file path. ```shell sed 'line_numberq;d' file_path ``` -------------------------------- ### List environment variables in Docker Source: https://www.commands.dev/workflows/list_environment_variables_from_a_docker_container This command executes the 'env' utility inside a specified Docker container to display all current environment variables. It requires the container to be running and the 'env' command to be available within the container's image. ```bash docker exec container env ``` -------------------------------- ### Generate CSR from Configuration using OpenSSL Source: https://www.commands.dev/workflows/generate_csr_from_config Generates a Certificate Signing Request (CSR) from a configuration template file. The generated CSR requires signing by a Certification Authority. This command uses the openssl tool and requires a configuration file as input and outputs a CSR file. ```bash openssl req -new -config csr_template.conf -out client.csr -verbose ``` -------------------------------- ### Redirect stdout to a file in Shell Source: https://www.commands.dev/workflows/redirect_stdout This command executes a specified command and redirects its standard output to a target file. If /dev/null is used as the file, the output is discarded. ```shell command 1> file ``` -------------------------------- ### Upgrade Yarn dependencies interactively Source: https://www.commands.dev/workflows/update_each_yarn_dependency_to_the_latest_version This command launches the interactive Yarn upgrade tool, which allows developers to select specific dependencies to update to their latest versions. It is useful for managing package updates without manually editing the package.json file. ```shell yarn upgrade-interactive --latest ``` -------------------------------- ### Initialize an empty array in Shell Source: https://www.commands.dev/workflows/array_create This command creates a new, empty array and assigns it to the variable named 'array_name'. It is compatible with Bash and other POSIX-compliant shells that support array syntax. ```shell array_name=() ``` -------------------------------- ### Migrate CRA to Nx CLI Command Source: https://www.commands.dev/workflows/nx-migrate-cra Executes the migration script to convert a Create-React-App project into an Nx workspace. This command requires npx and should be run within the root directory of the existing project. ```bash npx cra-to-nx ``` -------------------------------- ### List Processes at Port (macOS Shell) Source: https://www.commands.dev/workflows/list_processes_at_port This command lists all processes currently running on a specific network port. It is useful for identifying which applications are using a particular port, which can help in debugging network issues or freeing up ports. ```shell lsof -i:port ``` -------------------------------- ### Checkout a branch with Graphite Source: https://www.commands.dev/workflows/gt_branch_checkout The 'gt bco' command allows users to quickly switch to an existing branch or checkout a new one. It requires a branch name as an argument and functions similarly to the standard 'git checkout' command. ```bash gt bco ``` ```bash gt bco main ``` -------------------------------- ### Initiate NativeScript Debug Session Source: https://www.commands.dev/workflows/debug_the_project This command triggers a full debug cycle for a NativeScript project. It handles the preparation, build, and deployment phases before attaching the debugger to the target device or emulator. ```bash ns debug platform ``` -------------------------------- ### Encrypt RSA Private Key with AES256 using OpenSSL Source: https://www.commands.dev/workflows/add_passwd_to_rsa_key This command takes an existing unencrypted RSA private key and adds an AES256 password protection layer. The user will be prompted to enter a passphrase during execution to secure the output file. ```bash openssl rsa -aes256 -in in.key -out out.key ``` -------------------------------- ### Run Playwright Test File Source: https://www.commands.dev/workflows/run-a-single-test-file Executes a specific Playwright test file using the npx command line interface. ```APIDOC ## POST /run-playwright-test ### Description Runs a single Playwright test file provided by the user path. ### Method POST ### Endpoint /run-playwright-test ### Parameters #### Request Body - **pathToFile** (string) - Required - The relative or absolute path to the Playwright test file to be executed. ### Request Example { "pathToFile": "tests/example.spec.ts" } ### Response #### Success Response (200) - **status** (string) - Execution status of the test file. #### Response Example { "status": "success", "output": "Running 1 test using 1 worker..." } ``` -------------------------------- ### Export Public RSA Key using OpenSSL Source: https://www.commands.dev/workflows/export_public_rsa_key This command exports the public portion of an RSA private key to a new file. It requires the input private key file and specifies the output file for the public key. This is useful for sharing your public key without exposing your private key. ```bash openssl rsa -in in.key -pubout -out out.key ``` -------------------------------- ### Optimize CosmWasm Workspace with Docker Source: https://www.commands.dev/workflows/cosmwasm-optimize-workspace Runs the CosmWasm workspace optimizer in a Docker container. It mounts the current directory and necessary cache volumes to ensure efficient builds and optimized contract binaries. ```bash docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer:0.12.10 ``` -------------------------------- ### Create and Push New Git Branch Source: https://www.commands.dev/workflows/create_new_git_remote_branch This command creates a new local branch using git checkout and immediately pushes it to the specified remote repository. It requires the branch name and remote name as inputs. ```bash git checkout -b branch_name git push origin branch_name ``` -------------------------------- ### Build NativeScript Project for Android/iOS Source: https://www.commands.dev/workflows/build_the_project Builds your NativeScript project for Android or iOS, producing an application package for manual deployment on a device or native emulator. This command is essential for the NativeScript development workflow. ```bash ns build platform ``` -------------------------------- ### Copy files from host to Docker container Source: https://www.commands.dev/workflows/copy_files_from_a_host_to_a_docker_container This command transfers files from the local filesystem to a specified destination inside a Docker container. It requires the local file path, the container ID, and the target destination path within the container. ```shell docker cp local_file_path container_id:/container_filepath ``` -------------------------------- ### Manually Trigger Jamf Policy via Event Name Source: https://www.commands.dev/workflows/manually_initiate_policy_custom_triggername This command initiates a Jamf policy manually using its specific event trigger name. It requires the Jamf binary and the event name as input. The verbose flag provides detailed output during execution. ```bash sudo jamf policy -event "triggerName" -verbose ``` -------------------------------- ### Find and process files by extension Source: https://www.commands.dev/workflows/search_files_and_process This command uses find with regex to locate files matching specific image extensions and passes them to xargs for processing. It is useful for batch operations on files within a directory tree. ```shell find -E . -iregex ".*\.(jpg|jpeg|png|bmp)" -print | xargs -n1 -I _item echo _item ``` -------------------------------- ### Run NativeScript Application Source: https://www.commands.dev/workflows/run_project_on_device Executes the specified NativeScript application on a connected Android or iOS device. ```APIDOC ## ns run application_id ### Description Runs the selected NativeScript application on a connected Android or iOS device. ### Method Not Applicable (Command Line Interface) ### Endpoint Not Applicable (Command Line Interface) ### Parameters #### Path Parameters - **application_id** (string) - Required - The identifier of the NativeScript application to run. ### Request Example ```bash ns run com.example.myapp ``` ### Response #### Success Response (0) Indicates that the application has been successfully launched on the device. #### Response Example ``` Application launched successfully. ``` ``` -------------------------------- ### Prune all unused Docker resources Source: https://www.commands.dev/workflows/remove_all_stopped_docker_containers This command performs a comprehensive cleanup of all unused containers, networks, images, and volumes. It is useful for reclaiming significant disk space in a development environment. ```bash docker system prune ``` -------------------------------- ### Restore MySQL Dump File Source: https://www.commands.dev/workflows/restore_a_dump_file_from_a_mysqldump Restores a MySQL database from a specified dump file using the mysql command-line client. Ensure you have the necessary user privileges and the dump file path is correct. This command takes the dump file as standard input. ```bash mysql -u user -p < dump_filepath ``` -------------------------------- ### Shell For-Loop Syntax Source: https://www.commands.dev/workflows/shell_for_loop The standard syntax for a shell for-loop. It iterates through a defined sequence and executes the specified command for each item. ```shell for variable in sequence; do command done ``` ```shell for i in $( ls ); do echo item: $i done ``` -------------------------------- ### cURL URL with Redirects Source: https://www.commands.dev/workflows/c_url_a_url_and_follow_redirects This command fetches the content of a specified URL. The -L flag instructs cURL to follow any HTTP redirects encountered during the request. ```shell curl -L url ``` -------------------------------- ### Copy File from Docker Container to Host Source: https://www.commands.dev/workflows/copy_a_file_from_a_docker_container_to_the_current_host This command copies files from a specified Docker container to the local host machine. The container does not need to be running for this operation. It requires the container ID, the file path within the container, and the destination path on the host. ```bash docker cp container_id:container_filepath local_filepath ``` -------------------------------- ### Recursively Search Files by Extension using Grep Source: https://www.commands.dev/workflows/recursively_search_through_files_that_match_an_extension This command recursively searches through all files that match a specified extension for a given search term. It utilizes the grep utility with specific options to filter results. The input includes the file extension, the search term, and the file or directory to search within. ```bash grep -r --include=\*.extension 'search_term' file_name ``` -------------------------------- ### List Kubernetes Pod Events using Field Selector Source: https://www.commands.dev/workflows/list_events_for_a_single_kubernetes_pod This command retrieves all events related to a specific Kubernetes pod. It utilizes the `--field-selector` flag to filter events by the pod's name within a given namespace. Ensure you have kubectl configured to access your Kubernetes cluster. ```bash kubectl get event --namespace --field-selector involvedObject.name= ``` -------------------------------- ### Generate Self-Signed SSL Certificate via OpenSSL Source: https://www.commands.dev/workflows/generate_a_self_signed_ssl_certificate This command generates a new RSA 4096-bit private key and a corresponding self-signed X.509 certificate. It uses SHA-256 for the signature and sets the expiration to 365 days. ```bash openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 ``` -------------------------------- ### Kill processes at a port using shell Source: https://www.commands.dev/workflows/kill_processes_at_port This command uses lsof to find the process ID (PID) listening on a specified port and kills it using the kill command. It is designed for macOS and Unix-like shell environments. ```shell kill $(lsof -t -i:port) ``` -------------------------------- ### Wait for Kubernetes Job Completion (kubectl) Source: https://www.commands.dev/workflows/report_when_a_kubernetes_job_has_finished Waits for a specified Kubernetes job to complete. The default timeout is 30 seconds, but can be adjusted by passing in the --timeout flag. This command is useful for scripting and automation where you need to ensure a job has finished before proceeding. ```bash kubectl wait --for=condition=complete job/job_name ``` -------------------------------- ### Export MySQL Schema with mysqldump Source: https://www.commands.dev/workflows/export_my_sql_dataabase_schema_without_exporting_its_data This command uses the mysqldump utility to export only the schema definition of a specified database. It requires the host, username, and database name as inputs and outputs the result to a specified SQL file path. ```bash mysqldump -h host_name_or_ip -u username -p --no-data dbname > output_sql_file_path ``` -------------------------------- ### Check file readability in Shell Source: https://www.commands.dev/workflows/check_if_file_exists_and_is_readable_by_the_current_process This command uses the test operator to verify if a file exists and is readable. It returns an exit code of 0 on success, which is useful for conditional logic in scripts. ```shell [[ -r file ]] ``` -------------------------------- ### Push a Git Tag to Remote Source: https://www.commands.dev/workflows/push_a_tag_to_a_remote_git_repository This command pushes a specific tag to the origin remote repository. It requires the tag_name variable to be replaced with the actual name of the tag you wish to push. ```bash git push origin tag_name ``` -------------------------------- ### Find Largest 10 Files in Directory (Shell) Source: https://www.commands.dev/workflows/find_biggest_files This command uses 'du' to calculate file and directory sizes, 'sort' to order them by size in reverse, and 'head' to display the top 10 largest entries. It operates on the current working directory. ```shell du -ah . | sort -hr | head -n 10 ``` -------------------------------- ### Run Chef Cookbook Manually Source: https://www.commands.dev/workflows/run_cookbook_manually Executes a specific Chef recipe using the sudo chef-client command with the -o (override) flag. This command requires root privileges and is typically used to apply configuration changes outside of the standard scheduled run. ```bash sudo chef-client -o recipe['cookbook'] ``` -------------------------------- ### Generate Laravel Events and Listeners Source: https://www.commands.dev/workflows/laravel_event_generate This command scans the EventServiceProvider and automatically creates any missing event classes and listener classes. It is a time-saving utility for maintaining event-driven architecture in Laravel applications. ```bash php artisan event:generate ``` -------------------------------- ### Attach Header to HTTP Request with cURL Source: https://www.commands.dev/workflows/attach_a_header_to_an_http_request_with_c_url This command demonstrates how to attach a custom header to an HTTP request using cURL. It utilizes the --header flag to specify the header key-value pair and the target URL. This is useful for authentication or passing specific metadata in API requests. ```bash curl --header "header" url ``` -------------------------------- ### Set Bearer Authorization Header with cURL Source: https://www.commands.dev/workflows/set_an_bearer_authorization_header_with_a_c_url_request This command demonstrates how to send an HTTP request using cURL, including a Bearer token in the Authorization header. It requires the access token and the target URL as inputs. This is a common method for authenticating API requests. ```bash curl -H "Authorization: Bearer access_token" url ``` -------------------------------- ### Generate RSA Key with ssh-keygen Source: https://www.commands.dev/workflows/generate_key Generates a new RSA key pair using the ssh-keygen utility. It includes parameters for key type, bit size, KDF rounds, and file output configuration. ```bash ssh-keygen -t rsa -b 2048 -o -a 100 -C "" -f "" ``` -------------------------------- ### Export PostgreSQL Query Result to CSV Source: https://www.commands.dev/workflows/store_result_of_a_postgre_sql_query_as_a_csv_file This command executes a SQL query against a specified PostgreSQL database and redirects the output into a CSV file. It uses the psql utility with flags to ensure the output is unaligned and separated by commas. ```bash psql -d dbname -t -A -F"," -c "query" > file_name ``` -------------------------------- ### Reset File to Git Revision using Git Source: https://www.commands.dev/workflows/reset_file_back_to_git_revision This command resets a specified file back to its state at a given commit hash. It's useful for undoing changes to a file and reverting it to a known good version. Ensure you have the correct commit hash and file name. ```bash git reset commit_hash file_name ``` -------------------------------- ### Convert PKCS#12 to PEM using OpenSSL Source: https://www.commands.dev/workflows/convert_pkcs12_to_pem This command converts a certificate from PKCS#12 container format (including the private key) to PEM format (base64 encoded). It's a common operation for preparing certificates for various applications and servers. The '-nodes' flag prevents encrypting the private key. ```bash openssl pkcs12 -in in_cert.pfx -out out_cert.pem -nodes ``` -------------------------------- ### Redirect stderr to a file using shell Source: https://www.commands.dev/workflows/redirect_stderr This command executes a specified command and redirects its standard error (stderr) stream to a file. If you wish to discard stderr entirely, you can redirect it to `/dev/null`. ```shell command 2> file ``` -------------------------------- ### Add Amazon S3 Resource Source: https://www.commands.dev/workflows/resources_create_s3 This command adds an Amazon S3 resource to the Meroxa Platform. You need to provide the resource name, AWS access key, AWS secret access key, AWS region, and the S3 bucket name. ```APIDOC ## POST /resources/s3 ### Description Adds an Amazon S3 resource to the Meroxa Platform. ### Method POST ### Endpoint /resources/s3 ### Parameters #### Request Body - **resource_name** (string) - Required - The name for the new S3 resource. - **aws_access_key** (string) - Required - Your AWS access key ID. - **aws_access_secret** (string) - Required - Your AWS secret access key. - **aws_region** (string) - Required - The AWS region where your S3 bucket is located. - **aws_s3_bucket** (string) - Required - The name of your S3 bucket. ### Request Example ```json { "resource_name": "my-s3-bucket", "aws_access_key": "YOUR_ACCESS_KEY", "aws_access_secret": "YOUR_SECRET_KEY", "aws_region": "us-east-1", "aws_s3_bucket": "my-unique-bucket-name" } ``` ### Response #### Success Response (201 Created) - **id** (string) - The unique identifier of the created resource. - **name** (string) - The name of the resource. - **type** (string) - The type of the resource (e.g., "s3"). #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "my-s3-bucket", "type": "s3" } ``` ``` -------------------------------- ### Sort file by line length using AWK and sort Source: https://www.commands.dev/workflows/sort_a_file_by_line_length This command reads a file, prepends the length of each line to the line itself, sorts the resulting stream numerically, and then removes the length prefix. The -s flag ensures stable sorting for lines of equal length. ```bash cat file_name | awk '{ print length, $0 }' | sort -n -s | cut -d" " -f2- ``` -------------------------------- ### Compare two strings for inequality in Shell Source: https://www.commands.dev/workflows/check_if_two_strings_are_not_equal_to_each_other This command checks if two provided strings are not equal. It returns an exit code of 0 if the strings differ, which is useful for conditional logic in shell scripts. ```shell [[ string_1 != string_2 ]] ``` -------------------------------- ### Sum Numbers in File using Awk Source: https://www.commands.dev/workflows/sum_all_numbers_in_a_file This command uses awk to sum all the numbers in a given file. It is designed to handle large numbers by internally converting them to strings, ensuring accuracy. The OFMT format specifier is used to ensure the output is a whole number. ```awk awk 'BEGIN {OFMT = "%.0f"} { sum += $1 } END { print sum }' file_name ``` -------------------------------- ### Set OAuth Authorization Header with cURL Source: https://www.commands.dev/workflows/set_an_o_auth_authorization_header_with_a_c_url_request This snippet demonstrates how to send a request using cURL with an OAuth access token in the Authorization header. It requires a valid OAuth access token and the target URL. ```bash curl -H "Authorization: OAuth access_token" url ``` -------------------------------- ### Export SQLite query to CSV Source: https://www.commands.dev/workflows/export_sq_lite_query_to_a_csv_file Executes a specified SQL query against a target SQLite database file and saves the result set as a CSV file. This command uses the standard sqlite3 CLI tool and shell redirection. ```bash sqlite3 -header -csv db_filepath "sql_query" > output_filepath ``` -------------------------------- ### Generate Laravel Application Key Source: https://www.commands.dev/workflows/laravel_application_key_generate This command generates a new application key for a Laravel project. This key is used for session encryption and other security-sensitive operations. Ensure you run this command in your Laravel project's root directory. ```bash php artisan key:generate ``` -------------------------------- ### Remove all global NPM modules Source: https://www.commands.dev/workflows/remove_all_global_npm_modules This command lists all top-level global NPM modules and removes them using xargs. It uses awk to filter out the NPM package itself to prevent breaking the environment. ```bash npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm ``` -------------------------------- ### Stop Android App using ADB Source: https://www.commands.dev/workflows/stop_an_android_app This command force-stops a specified Android application using the Android Debug Bridge (ADB). It requires the package name of the app to be provided as an argument. This is useful for debugging or resetting app states. ```bash adb shell am force-stop com.my.app.package ``` -------------------------------- ### Remove empty lines from a file using sed Source: https://www.commands.dev/workflows/delete_empty_lines_in_a_file This command uses sed to identify and delete lines containing only whitespace characters. It takes a file name as an argument and outputs the modified content, which can be redirected to a new file or used in a pipeline. ```bash sed '/^[[:space:]]*$/d' file_name ``` -------------------------------- ### Recursive Find and Replace using grep and sed Source: https://www.commands.dev/workflows/recursively_find_and_replace_within_a_directory This command recursively searches for a specified string within a directory and replaces it with a new string. It uses grep to identify files containing the pattern and pipes the result to sed for in-place modification. ```bash grep -rl old_text file_path | xargs sed -i '' 's/old_text/new_text/g' ``` -------------------------------- ### Compare Integers in Shell Source: https://www.commands.dev/workflows/check_if_a_number_is_less_than_another_number Checks if integer_a is less than or equal to integer_b. Returns an exit code of 0 if the condition is true. This command is useful for conditional logic in shell scripting. ```shell [[ integer_a -lt integer_b ]] ``` -------------------------------- ### Check String Equality in Shell Source: https://www.commands.dev/workflows/check_if_two_strings_are_equal_to_each_other This command checks if two strings are equal to each other. It returns an exit code of 0 if the strings match, indicating success. This is useful for conditional logic in shell scripts. ```shell [[ string_1 = string_2 ]] ``` -------------------------------- ### Reset Graphite CLI Metadata and Cache Source: https://www.commands.dev/workflows/gt_troubleshoot_graphite_cli This command sequence resets the Graphite repository metadata and clears the local cache. It is useful for troubleshooting synchronization issues or corrupted local state. ```bash gt repo init --reset && gt dev cache --clear ``` -------------------------------- ### Clean NativeScript Project Artifacts with 'ns clean' Source: https://www.commands.dev/workflows/clean_project_artifacts The 'ns clean' command is used to remove temporary files and build artifacts from your NativeScript project. This is useful for troubleshooting build issues or ensuring a clean state before a new build. It operates on the project's build directories. ```shell ns clean ``` -------------------------------- ### Check SSL certificate expiration date with OpenSSL Source: https://www.commands.dev/workflows/show_ssl_certificate_expiration_date_from_an_encoded_certificate This command reads a PEM encoded certificate file and outputs the expiration date. It uses the -enddate flag to isolate the expiration timestamp and -noout to suppress the full certificate output. ```bash openssl x509 -enddate -noout -in cert.pem ``` -------------------------------- ### Check if File is Executable (Shell) Source: https://www.commands.dev/workflows/check_if_file_exists_and_is_executable_by_the_current_process This command checks if a given file exists and is executable by the current process. It returns an exit code of 0 if the file is executable, and a non-zero exit code otherwise. This is useful for scripting and automation where you need to ensure a file can be run before attempting to execute it. ```shell [[ -x file ]] ```