Files
meteor/docs/client/commandline.html
2014-08-20 13:54:14 -07:00

213 lines
7.0 KiB
HTML

<template name="commandline">
<div>
{{#markdown}}
<h1 id="commandline">Command line</h1>
<!-- XXX some intro text? -->
<h3 id="meteorhelp">meteor help</h3>
Get help on meteor command line usage. Running `meteor help` by
itself will list the common meteor
commands. Running <code>meteor help <i>command</i></code> will print
detailed help about the command.
<h3 id="meteorrun">meteor run</h3>
Run a meteor development server in the current project. Searches
upward from the current directory for the root directory of a Meteor
project. Whenever you change any of the application's source files, the
changes are automatically detected and applied to the running
application.
You can use the application by pointing your web browser at
<a href="http://localhost:3000">localhost:3000</a>. No internet connection is
required.
This is the default command. Simply running `meteor` is the
same as `meteor run`.
To pass additional options to Node.js use the `NODE_OPTIONS` environment variable.
For example: `NODE_OPTIONS='--debug'` or `NODE_OPTIONS='--debug-brk'`
Run `meteor help run` to see the full list of options.
<h3 id="meteorcreate">meteor create <i>name</i></h3>
Create a new Meteor project. Makes a subdirectory named *name*
and copies in the template app. You can pass an absolute or relative
path.
<h3 id="meteordeploy">meteor deploy <i>site</i></h3>
Deploy the project in your current directory to Meteor's servers.
You can deploy to any available name
under `meteor.com` without any additional
configuration, for example, `myapp.meteor.com`. If
you deploy to a custom domain, such as `myapp.mydomain.com`,
then you'll need to make sure the DNS for that domain is configured to
point at `origin.meteor.com`.
The first time you deploy an app you'll be prompted for an email address &mdash;
follow the link in your email to finish setting up your account.
Once you have your account you can log in and log out from the command line,
check your username with `meteor whoami`, and run `meteor authorized` to give
other Meteor developers permissions to deploy your app and access its database
and logs.
You can deploy in debug mode by passing `--debug`. This
will leave your source code readable by your favorite in-browser
debugger, just like it is in local development mode.
To delete an application you've deployed, specify
the `--delete` option along with the site.
{{#warning}}
If you use a domain name other than `meteor.com`
you must ensure that the name resolves
to `origin.meteor.com`. If you want a top-level
domain like myapp.com, you'll need a DNS A record, matching the IP
address of origin.meteor.com.
{{/warning}}
You can add information specific to a particular deployment of your application
by using the `--settings` option. The argument to `--settings` is a file
containing any JSON string. The object in your settings file will appear on the
server side of your application in [`Meteor.settings`](#meteor_settings).
Settings are persistent. When you redeploy your app, the old value will be
preserved unless you explicitly pass new settings using the `--settings` option.
To unset `Meteor.settings`, pass an empty settings file.
<h3 id="meteorlogs">meteor logs <i>site</i></h3>
Retrieves the server logs for the named Meteor application.
Meteor redirects the output of `console.log()` in your
server code into a logging server. `meteor logs`
displays those logs. In client code, the output
of `console.log()` is available in your web browser's
inspector, just like any other client-side JavaScript.
<h3 id="meteorupdate">meteor update</h3>
Sets the version of Meteor to use with the current project. If a
release is specified with `--release`, set the project to use that
version. Otherwise download and use the latest release of Meteor.
Every project is pinned to a specific release of Meteor. You can temporarily try
using your package with another release by passing the `--release` option to any
command; `meteor update` simply changes the pinned release.
<h3 id="meteoradd">meteor add <i>package</i></h3>
Add packages to your Meteor project. You can add multiple packages
with one command. For a list of the available packages, run `meteor
list`.
<h3 id="meteorremove">meteor remove <i>package</i></h3>
Removes a package previously added to your Meteor project. For a
list of the packages that your application is currently using, run
`meteor list --using`.
<h3 id="meteorlist">meteor list</h3>
Without arguments, lists all available Meteor packages. To add one of
these packages to your project, run <code>meteor add <i>package</i></code>.
With `--using`, list the packages that you have added to your project.
<h3 id="meteoraddplatform">meteor add-platform <i>platform</i></h3>
Adds platforms to your Meteor project. You can add multiple
platforms with one command. Once a platform has been added, you
can use 'meteor run <i>platform</i>' to run on the platform, and 'meteor build'
to build the Meteor project for every added platform.
<h3 id="meteorremoveplatform">meteor remove-platform <i>platform</i></h3>
Removes a platform previously added to your Meteor project. For a
list of the platforms that your application is currently using, see
'meteor list-platforms'.
<h3 id="meteorlistplatforms">meteor list-platforms</h3>
Lists all of the platforms that have been explicitly added to your project.
<h3 id="meteormongo">meteor mongo</h3>
Open a MongoDB shell on your local development database, so that you
can view or manipulate it directly.
{{#warning}}
For now, you must already have your application running locally
with `meteor run`. This will be easier in the future.
{{/warning}}
<h3 id="meteorreset">meteor reset</h3>
Reset the current project to a fresh state. Removes the local
mongo database.
{{#warning}}
This deletes your data! Make sure you do not have any information you
care about in your local mongo database by running `meteor
mongo`. From the mongo shell, use `show collections`
and <code>db.<i>collection</i>.find()</code> to inspect your data.
{{/warning}}
{{#warning}}
For now, you can not run this while a development server is
running. Quit all running meteor applications before running this.
{{/warning}}
<h3 id="meteorbuild">meteor build</h3>
Package this project up for deployment. The output is a directory with several
build artifacts:
<ul><li>a tarball that includes everything necessary to run the application server
(see `README` in the tarball for details)</li>
<li>an unassigned `apk` bundle and a project source if Android is targetted as a
mobile platform</li>
<li>a directory with an Xcode project source if iOS is targetted as a mobile
platform</li></ul>
You can use the application server bundle to host a Meteor application on your
own server, instead of deploying to Meteor's servers. You will have to deal
with logging, monitoring, backups, load-balancing, etc, all of which we handle
for you if you use `meteor deploy`.
Unassigned `apk` bundle and the outputted Xcode project can be used to deploy
your mobile apps to Android Play Store and Apple App Store.
{{/markdown}}
</div>
</template>