Wiki Page: Cli Environment Variable Commands

  • Thread starter Thread starter David Berger
  • Start date Start date
Status
Not open for further replies.
D

David Berger

Guest
QUICK REFERENCE env list List your current project's environment variables. env get List a single environment variable. env set Create a variable with the name and value provided, or if the project has a variable with the name provided, it will be set to the value provided. env load Create or set environment variables for a project using data loaded from a JSON file. env delete Delete the variable with the name provided. ENV LIST List your current project's environment variables. Params No Params Prompts select project If you have more than one project, you must select the project before continuing. Example $ modulus env list Welcome to Modulus You are logged in as spiderman [?] Are you sure you want to use project Lizard Locator? (yes) yes Project Lizard Locator Environment Variables NODE_ENV = production ENV GET List a single environment variable. Params name The name of the variable to get. Prompts select project If you have more than one project, you must select the project before continuing. Example $ modulus env get NODE_ENV Welcome to Modulus You are logged in as spiderman [?] Are you sure you want to use project Lizard Locator? (yes) yes Project Lizard Locator Environment Variables NODE_ENV = production ENV SET Create a variable with the name and value provided, or if the project has a variable with the name provided, it will be set to the value provided. Params name The name of the variable to create or set. value The value to set the variable to. Prompts select project If you have more than one project, you must select the project before continuing. Example $ modulus env set DB_AUTH 12345 Welcome to Modulus You are logged in as spiderman [?] Are you sure you want to use project Lizard Locator? (yes) yes Setting DB_AUTH for project Lizard Locator [√] Successfully set environment variable. ENV LOAD Create or set environment variables for a project using data loaded from a JSON file. Params file The path to the file that contains variable names and values to create or set. Prompts select project If you have more than one project, you must select the project before continuing. Example JSON data may be a hash of values or complex objects that will be parsed by your project at runtime. Object and Array values will be stringified and saved to the variable. Note that environment variable names cannot start with numbers and can only contain alpha-numeric characters and underscores. Environment variable values cannot contain single quotes. { "NODE_ENV": "production", "CONFIG": { "url": "http://example.com", "list": [ "list", "data" ] } } This file creates/updates two environment variables, one with the string value 'production' , the other with the string value '{"url": "http://example.com","list": ["list","data"]}' . $ modulus env load config.json Welcome to Modulus You are logged in as spiderman [?] Are you sure you want to use project Lizard Locator? (yes) yes [√] Successfully set environment variables loaded from file. ENV DELETE Delete the variable with the name provided Params name The name of the variable to delete. Prompts select project If you have more than one project, you must select the project before continuing. Example $ modulus env delete DB_AUTH Welcome to Modulus You are logged in as spiderman [?] Are you sure you want to use project Lizard Locator? (yes) yes Deleting DB_AUTH for project Lizard Locator [√] Successfully deleted variable DB_AUTH from project Lizard Locator

Continue reading...
 
Status
Not open for further replies.
Back
Top