### Display run_api Help Source: https://github.com/nephroflow/nfde/blob/master/README.md Shows the help message for the run_api script, which is likely used to start the API service. ```bash run_api -h ``` -------------------------------- ### Install nfde using Cargo Source: https://github.com/nephroflow/nfde/blob/master/README.md Installs the NephroFlow Development Environment Manager (nfde) from its GitHub repository using Cargo, Rust's package manager. Ensure Cargo is installed. ```bash cargo install --git https://www.github.com/nephroflow/nfde.git ``` -------------------------------- ### Configure nfde Environment Source: https://context7.com/nephroflow/nfde/llms.txt Launch the interactive wizard to set up environment-specific paths and names. ```bash # Run interactive configuration nfde config ``` -------------------------------- ### Run Full Healthcheck via CLI Source: https://context7.com/nephroflow/nfde/llms.txt Verifies system prerequisites including PostgreSQL tools, Docker, and configuration files. ```bash nfde database dump test ``` -------------------------------- ### Display nfde Help Source: https://github.com/nephroflow/nfde/blob/master/README.md Shows the help message for the nfde command-line tool, listing available commands and options. ```bash nfde -h ``` -------------------------------- ### Dump Database State Source: https://context7.com/nephroflow/nfde/llms.txt Create a PostgreSQL dump of the development database. Requires PGPASSWORD to be set in the environment. ```bash # Prerequisites: # 1. Export PGPASSWORD in your shell profile export PGPASSWORD=your_postgres_password # 2. Start postgres service with exposed ports docker-compose run --service-ports postgres # Dump the current database state nfde database dump feature-user-auth ``` -------------------------------- ### Load Docker Image with nfde Source: https://context7.com/nephroflow/nfde/llms.txt Imports a saved Docker image from a tar archive. Use without arguments for an interactive picker. ```bash nfde docker load before-upgrade-v2 ``` ```bash nfde docker load ``` -------------------------------- ### Dump PostgreSQL Database Source: https://github.com/nephroflow/nfde/blob/master/README.md Use this command to dump the PostgreSQL database for a specific environment. Ensure the PostgreSQL service is running and accessible. ```bash nfde database dump $name ``` -------------------------------- ### Restore Database Backup Source: https://context7.com/nephroflow/nfde/llms.txt Restore a database dump by name or via interactive fuzzy selection. ```bash # Restore by name nfde database restore feature-user-auth # Or use interactive selection (opens fuzzy picker) nfde database restore ``` -------------------------------- ### Define Configuration Structure Source: https://context7.com/nephroflow/nfde/llms.txt The Config struct defines the schema for persistent settings stored in the TOML configuration file. ```rust // Configuration structure stored in ~/.config/nfde/default-config.toml pub struct Config { pub api_container_name: String, // Default: "nephroflow-web-1" pub api_image_name: String, // Default: "nephroflow/server" pub backup_image_path: String, // Path for Docker image backups pub backup_database_path: String, // Path for database dump files pub nephroflow_database_name: String, // Default: "nephroflow_development" } ``` -------------------------------- ### Load Docker Image Source: https://github.com/nephroflow/nfde/blob/master/README.md Loads a previously saved Docker image. This command assumes the image has been saved using `nfde docker save`. ```bash nfde docker load ``` -------------------------------- ### View nfde Configuration Source: https://github.com/nephroflow/nfde/blob/master/README.md Displays the current configuration for the NephroFlow Development Environment Manager. This includes settings for Docker image, container, and database names, as well as backup paths. ```bash nfde config ``` -------------------------------- ### Save Docker Image with nfde Source: https://context7.com/nephroflow/nfde/llms.txt Saves the current API image to a tar archive in the backup directory. ```bash nfde docker save before-upgrade-v2 ``` -------------------------------- ### Save Docker Image Source: https://github.com/nephroflow/nfde/blob/master/README.md Saves a Docker image with the specified name. This is useful for backing up or transferring images. ```bash nfde docker save $name ``` -------------------------------- ### Restore PostgreSQL Database Source: https://github.com/nephroflow/nfde/blob/master/README.md Restore a previously dumped PostgreSQL database. The tool will attempt to stop the 'rails' process of the 'web' service before restoring. A fuzzy picker will be presented to select the database to restore. ```bash nfde database restore ``` -------------------------------- ### Execute Commands in API Container Source: https://context7.com/nephroflow/nfde/llms.txt Runs commands inside the NephroFlow API container, automatically handling container state. ```bash run_api -- rails console run_api -- rails db:migrate run_api --not-interactive -- bundle exec rspec spec/models/ run_api -- rake nephroflow:sync_data ``` -------------------------------- ### Interact with Container via Rust API Source: https://context7.com/nephroflow/nfde/llms.txt Provides low-level functions for container management and command execution within Rust code. ```rust use lib::nf_container_api::{ execute_on_nephroflow_container, is_nephroflow_container_running, stop_rails_server, }; // Check if the container is running if is_nephroflow_container_running() { println!("Container is active"); } // Execute a command in the container let command = vec!["rails".to_string(), "db:migrate".to_string()]; execute_on_nephroflow_container(command, true)?; // true for interactive mode // Stop the Rails server (kills ruby processes) stop_rails_server()?; ``` -------------------------------- ### Remove Database Backup Source: https://context7.com/nephroflow/nfde/llms.txt Delete a saved database dump file from the configured backup directory. ```bash # Remove by name nfde database remove old-feature-backup # Or use interactive selection nfde database remove ``` -------------------------------- ### Run Healthchecks Programmatically Source: https://context7.com/nephroflow/nfde/llms.txt Validates specific system components using the healthcheck module in Rust. ```rust use lib::healthcheck; // Run all healthchecks healthcheck::run()?; // Run only database-related healthchecks healthcheck::db_run()?; // Run only Docker healthchecks healthcheck::docker_run()?; // Run only configuration healthchecks healthcheck::config_run()?; ``` -------------------------------- ### Remove Docker Image Backup Source: https://context7.com/nephroflow/nfde/llms.txt Deletes a saved Docker image tar file from the backup directory. ```bash nfde docker remove old-image-backup ``` ```bash nfde docker remove ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.