Command Line Arguments

The command takes a set of options, an action, and arguments for the action. This command is used for a variety of application management tasks including deploying your app and updating datastore indexes.

The appcfg tool is included with the App Engine SDK.

The App Engine SDK is updated frequently, and this list of arguments might not be current. Type help to see the list of all available actions, and help <action> for details on a particular action.

update [options] update <app-directory>|<files...>

The update action creates or updates the app version named in the app.yaml file at the top level of the directory.

If you specify a directory, it must contain an app.yaml file and all of the other files required by the app or the module that the app.yaml file defines. If the directory contains any global application settings files (index.yaml, queues.yaml, dispatch.yaml, dos.yaml, cron.yaml) they are also uploaded by the command. Note that if there are other module configuration files in the directory they will not be uploaded. You'll need to specify them using update with a file list.

The command follows symlinks and recursively uploads all files to the server. Temporary or source control files, such as foo~, .svn/* are skipped.

Use the files argument to upload one or more YAML files that define modules. No other types of YAML files can appear in the command line. Only the specified modules will be updated.

The following option applies to update:

Maximum size of a file to upload (in bytes).
Disables automatic Python precompilation. Precompilation increases the performance of an app and reduces the time to import a Python module or file, which can increase the speed of the first request handled by an app instance. If you encounter precompilation errors when deploying your app, try specifying this parameter.

help help <action>
Prints a help message about the given action, then quits.

cron_info [options] cron_info <app-directory>
Displays information about the scheduled task (cron) configuration, including the expected times of the next few executions. By default, displays the times of the next 5 runs. You can modify the number of future run times displayed with the --num_runs=... option.

download_app download_app -A <app_id> -V <version> <output-dir>

Retrieves the most current version of your application's code using the following options:

Required. The application ID.
Optional. Specifies the version of the code to download. If omitted, the default version is downloaded.
Required. The directory where you wish to save the files.

request_logs [options] request_logs <app-directory> <output-file>

Retrieves log data for the application running on App Engine. If the --append flag is set, output-file parameter is the name of the file to create, replace, or append. If output-file is a hyphen (-), the log data is printed to the console. The following options apply to request_logs:

The number of days of log data to retrieve, ending on the current date at midnight UTC. A value of 0 retrieves all available logs. If --append is given, then the default is 0, otherwise the default is 1.
The latest date of log data to return, in the form YYYY-MM-DD. The default is today. The --num_days option counts backwards from the end date.
The minimum log level for the log messages to retrieve. The value is a number corresponding to the log level: 4 for CRITICAL, 3 for ERROR, 2 for WARNING, 1 for INFO, 0 for DEBUG. All messages at the given log level and above are retrieved. Default is 1 (INFO).

Append the fetched data to the output file, starting with the first log line not already present in the file. Running this action once a day with --append results in a file containing all log data.

The default is to overwrite the output file. Does not apply if output-file is - (printing to the console).


If present, limits the log messages downloaded to just those emitted by requests for a given domain name. For example, downloads just the log messages for the live app at the Google Apps domain, excluding any log messages emitted by a new version being tested at Similarly, downloads just the logs for the test version, excluding the live version.

The value is a regular expression that matches the Host header of the incoming requests. Note that the pattern is case sensitive, even though domain names usually are not.


Include the domain name for each request (the Host request header) in the request log data, as an additional field.

rollback [options] rollback <app-directory>
Reverses a partially completed update for the given application. You can use this if an update was interrupted, and the command is reporting that the application cannot be updated due to a lock.

set_default_version [options] set_default_version <app-directory>
Specifies the default version of the given module.

migrate_traffic [options] migrate_traffic <app-directory>
Implements traffic migration. Dynamically re-routes traffic from the current default (serving) version of the app to the version specified in the app.yaml. Traffic is moved from the old to the new version in a few minutes, depending on how much traffic your app is receiving and how many instances are running. Once all traffic is migrated, the default (serving) version of the app is reset to the new version.

list_versions [options] list_versions <app-directory>
Outputs the uploaded versions for each module of an application in YAML. The YAML is formatted as an associative array, mapping module_ids to the list of versions uploaded for that module. The default version is first in the list.

delete_version [options] delete_version -A app_id -V version
Deletes the specified version for the specified application.

update_cron [options] update_cron <app-directory>
Updates the schedule task (cron) configuration for the app, based on the cron.yaml file.

update_dos [options] update_dos <app-directory>
Updates the DoS Protection configuration for the app, based on the dos.yaml file.

update_indexes [options] update_indexes <app-directory>
Updates datastore indexes in App Engine to include newly added indexes. If a new version of your application requires an additional index definition that was added to index.yaml, you can update your index definitions in App Engine prior to uploading the new version of your application. Running this action a few hours prior to uploading your new application version gives the indexes time to build and already be serving when the application is deployed.

update_queues [options] update_queues <app-directory>
Updates the task queue configuration for the app, based on the queue.yaml file.

update_dispatch [options] update_dispatch <app-directory>
Updates the dispatch for the app, based on the dispatch.yaml file.

start_module_version [options] start_module_version <app-directory>

Start the specified module version.

Use the --module and --version options to override the settings in the app.yaml file.

stop_module_version [options] stop_module_version <app-directory>

Stop the specified module version.

Use the --module and --version options to override the settings in the app.yaml file.

vacuum_indexes [options] vacuum_indexes <app-directory>
Deletes unused datastore indexes in App Engine. If an index definition is removed from index.yaml, the index is not deleted automatically when the application is uploaded because it may be in use by another version of the application. Run this action when all old indexes are no longer needed.

Global options

The command accepts the following options for all actions:

The application ID to use. By default, this is derived from the application: line in the app.yaml file in the application directory. If --application is specified, it overrides the ID in app.yaml for this action.
Force deletion of unused indexes. By default, uploading an app does not delete unused indexes from the server, even if they do not appear in the index.yaml file.
The hostname of the local machine for use with remote procedure calls.
A maximum size of files to upload, as a number of bytes. Files larger than this size will not be uploaded. The default is 10485760. The server enforces a maximum file size of 10,485,760 bytes, so increasing this value will not have any effect.
The name of the module to use. By default, this is derived from the module: line in the app.yaml file in the application directory. If --module is specified, it overrides the value in app.yaml for this action.
Do not store the user's access token. Go through the OAuth2 flow every time.
Print many messages about what the command is doing. This is mostly useful when working with the App Engine team to troubleshoot an upload issue.
Don't use the web browser to display web pages for authentication. This is useful for OAuth2 authentication if you're remotely logged on to a machine. This flag only applies for OAuth2.
Use an OAuth2 refresh token to authenticate instead of the default one stored in the user's home directory.
Do not print messages when successful.
The App Engine server hostname. The default is
Print messages about what the command is doing.
The version ID to use. By default, this is derived from the version: line in the app.yaml file in the application directory. If --version is specified, it overrides the version ID in app.yaml for this action.

Send feedback about...

App Engine standard environment for Python