Using the Prisma CLI
The Prisma command line interface (CLI) is the primary tool to deploy and manage your Prisma services.
The Prisma CLI helps you in areas such as:
- Bootstraping service configuration files for new services
- Deploying services to Prisma servers
- Generating authentication tokens
- Seeding, importing and exporting data
- ...and more
To get detailled information about all CLI commands, read the command reference.
The Prisma CLI can be installed from the NPM registry.
brew tap prisma/prisma brew install prismaCopy
npm install -g prismaCopy
yarn global add prismaCopy
$ prisma Prisma replaces traditional ORMs (https://www.prisma.io) Usage: prisma COMMAND Service: init Initialize a new service deploy Deploy service changes (or new service) introspect Introspect database schema(s) of service info Display service information (endpoints, cluster, ...) token Create a new service token list List all deployed services delete Delete an existing service Data workflows: playground Open service endpoints in GraphQL Playground seed Seed a service with data specified in the prisma.yml import Import data into a service export Export service data to local file reset Reset the stage data Cloud: login Login or signup to the Prisma Cloud logout Logout from Prisma Cloud console Open Prisma Console in browser account Display account information Use prisma help [command] for more information about a command. Docs can be found here: https://bit.ly/prisma-cli-commands Examples: - Initialize files for a new Prisma service $ prisma init - Deploy service changes (or new service) $ prisma deploy
Once installed, execute the following commands to get your Prisma API up-and-running and start sending queries and mutations to it:
prisma init hello-world # Select a *Demo server* from the interactive prompt cd hello-world prisma deploy prisma playground
You can now start sending queries and mutations to your Prisma API. For a more comprehensive walkthrough, check out the Get Started section.
The Prisma CLI integrates with
graphql-config. If your project uses a
.graphqlconfig.yml-file, you can use the
prisma extension and point it to your
projects: prisma: schemaPath: prisma.graphql extensions: prisma: prisma.yml
The Prisma CLI supports custom HTTP proxies. This is particularly relevant when being behind a corporate firewall.
To activate the proxy, provide the environment variables
HTTPS_PROXY. The behavior is very similar to how the
npm CLI handles this.
The following environment variables can be provided:
http_proxy: Proxy URL for http traffic, for example
https_proxy: Proxy URL for https traffic, for example
no_proxy: To disable the proxying for certain URLs, please provide a glob for
NO_PROXY, for example
To get a simple local proxy, you can use the
npm install -g proxy DEBUG="*" proxy -p 8080 HTTP_PROXY=http://localhost:8080 HTTPS_PROXY=https://localhost:8080 prisma deploy