Command Line Interface (CLI) — CKAN 2.10.0a0 documentation (2023)

The `` –config`` option tells CKAN where to find your config file, which itreads for example to know which database it should use. As you’ll see in theexamples below, this option can be given as -c for short.

The config file (ckan.ini) will generally be located in the/etc/ckan/default/ directory however it can be located in any directory onthe host machine

command should be replaced with the name of the CKAN command that you wishto execute. Most commands have their own subcommands and options.

(Here user is the name of the CKAN command you’re running, and list isa subcommand of user.)

Each command has its own help text, which tells you what subcommands andoptions it has (if any). To print out a command’s help text, run the commandwith the --help option, for example:

ckan Commands Reference

The following ckan commands are supported by CKAN:

asset

WebAssets commands.

config

Search, validate, describe config options

config-tool

Tool for editing options in a CKAN config file

datapusher

Perform commands in the datapusher.

dataset

Manage datasets.

datastore

Perform commands to set up the datastore.

db

Perform various tasks on the database.

generate

Generate empty extension files to expand CKAN

jobs

Manage background jobs

sass

Compile all root sass documents into their CSS counterparts

notify

Send out modification notifications.

plugin-info

Provide info on installed plugins.

profile

Code speed profiler.

run

Start Development server.

search-index

Creates a search index for all datasets

seed

Create test data in the database.

sysadmin

Gives sysadmin rights to a named user.

tracking

Update tracking statistics.

translation

Translation helper functions

user

Manage users.

views

Create views on relevant resources

asset: WebAssets commands

Usage

ckan asset build - Builds bundles, regardless of whether they are changed or notckan asset watch - Start a daemon which monitors source files, and rebuilds bundlesckan asset clean - Will clear out the cache, which after a while can grow quite large

config: Search, validate, describe config options

Usage

ckan config declaration [PLUGIN...] - Print declared config options for the given plugins.ckan config describe [PLUGIN..] - Print out config declaration for the given plugins.ckan config search [PATTERN] - Print all declared config options that match pattern.ckan config undeclared - Print config options that has no declaration.ckan config validate - Validate global configuration object against declaration.

config-tool: Tool for editing options in a CKAN config file

Usage

ckan config-tool --section (-s) - Section of the config fileckan config-tool --edit (-e) - Checks the option already exists in the config fileckan config-tool --file (-f) - Supply an options file to merge in

Examples

ckan config-tool /etc/ckan/default/ckan.ini sqlalchemy.url=123 'ckan.site_title=ABC'ckan config-tool /etc/ckan/default/ckan.ini -s server:main -e port=8080ckan config-tool /etc/ckan/default/ckan.ini -f custom_options.ini

datapusher: Perform commands in the datapusher

Usage

ckan datapusher resubmit - Resubmit udated datastore resourcesckan datapusher submit - Submits resources from package

dataset: Manage datasets

Usage

ckan dataset DATASET_NAME|ID - shows dataset propertiesckan dataset show DATASET_NAME|ID - shows dataset propertiesckan dataset list - lists datasetsckan dataset delete [DATASET_NAME|ID] - changes dataset state to 'deleted'ckan dataset purge [DATASET_NAME|ID] - removes dataset from db entirely

datastore: Perform commands in the datastore

Make sure that the datastore URLs are set properly before you run these commands.

Usage

ckan datastore set-permissions - generate SQL for permission configurationckan datastore dump - dump a datastore resourceckan datastore purge - purge orphaned datastore resources

db: Manage databases

ckan db clean - Clean the databaseckan db downgrade - Downgrade the databaseckan db duplicate_emails - Check users email for duplicateckan db init - Initialize the databaseckan db pending-migrations - List all sources with unapplied migrations.ckan db upgrade - Upgrade the databaseckan db version - Returns current version of data schema

See Database Management.

generate: Scaffolding for regular development tasks

Usage

ckan generate config - Create a ckan.ini file.ckan generate extension - Create empty extension.ckan generate fake-data - Generate random entities of the given category.ckan generate migration - Create new alembic revision for DB migration.

jobs: Manage background jobs

ckan jobs cancel - cancel a specific job.ckan jobs clear - cancel all jobs.ckan jobs list - list jobs.ckan jobs show - show details about a specific job.ckan jobs test - enqueue a test job.ckan jobs worker - start a worker

The jobs command can be used to manage Background jobs.

New in version 2.7.

Run a background job worker

ckan -c /etc/ckan/default/ckan.ini jobs worker [--burst] [QUEUES]

Starts a worker that fetches job from the job queues and executes them. If no queue names are given then it listens tothe default queue. This is equivalent to

ckan -c /etc/ckan/default/ckan.ini jobs worker default

If queue names are given then the worker listens to those queues and onlythose:

ckan -c /etc/ckan/default/ckan.ini jobs worker my-custom-queue another-special-queue

Hence, if you want the worker to listen to the default queue and some othersthen you must list the default queue explicitly

ckan -c /etc/ckan/default/ckan.ini jobs worker default my-custom-queue

If the --burst option is given then the worker will exit as soon as all itsqueues are empty. Otherwise it will wait indefinitely until a new job isenqueued (this is the default).

Note

In a production setting you should use a more robust way of runningbackground workers.

List enqueued jobs

ckan -c /etc/ckan/default/ckan.ini jobs list [QUEUES]

Lists the currently enqueued jobs from the given job queues. If no queue names are given then the jobs from all queues arelisted.

Show details about a job

ckan -c /etc/ckan/default/ckan.ini jobs show ID

Shows details about the enqueued job with the given ID.

Cancel a job

ckan -c /etc/ckan/default/ckan.ini jobs cancel ID

Cancels the enqueued job with the given ID. Jobs can only be canceled whilethey are enqueued. Once a worker has started executing a job it cannot beaborted anymore.

Clear job queues

ckan -c /etc/ckan/default/ckan.ini jobs clear [QUEUES]

Cancels all jobs on the given job queues. If noqueues are given then all queues are cleared.

Enqueue a test job

ckan -c /etc/ckan/default/ckan.ini jobs test [QUEUES]

Enqueues a test job. If no job queues are giventhen the job is added to the default queue. If queue names are given then aseparate test job is added to each of the queues.

sass: Compile all root sass documents into their CSS counterparts

Usage

sass

notify: Send out modification notifications

Usage

ckan notify replay - send out modification signals. In "replay" mode, an update signal is sent for each dataset in the database.

plugin-info: Provide info on installed plugins

As the name suggests, this commands shows you the installed plugins (based on the .ini file) , their description, and which interfaces they implement

profile: Code speed profiler

Provide a ckan url and it will make the request and record how long each function call took in a file that can be readby runsnakerun.

Usage

ckan profile URL

The result is saved in profile.data.search. To view the profile in runsnakerun:

runsnakerun ckan.data.search.profile

You may need to install the cProfile python module.

run: Start Development server

Usage

ckan run --host (-h) - Set Hostckan run --port (-p) - Set Portckan run --disable-reloader (-r) - Use reloaderckan run --passthrough_errors - Crash instead of handling fatal errors

Use --passthrough-errors to enable pdb

Exceptions are caught and handled by CKAN. Sometimes, user needs to disablethis error handling, to be able to use pdb or the debug capabilities of themost common IDE. This allows to use breakpoints, inspect the stack frames andevaluate arbitrary Python code.Running CKAN with --passthrough-errors will automatically disable CKANreload capabilities and run everything in a single process, for the sake ofsimplicity.

Example:

python -m pdb ckan run –passthrough-errors

search-index: Search index commands

Usage

ckan search-index check - Check search indexckan search-index clear - Clear the search indexckan search-index rebuild - Rebuild search indexckan search-index rebuild-fast - Reindex with multiprocessingckan search-index show - Show index of a dataset

search-index: Rebuild search index

Rebuilds the search index. This is useful to prevent search indexes from getting out of sync with the main database.

For example

ckan -c /etc/ckan/default/ckan.ini search-index rebuild

This default behaviour will refresh the index keeping the existing indexed datasets and rebuild it with all datasets. If you want to rebuild it for onlyone dataset, you can provide a dataset name

ckan -c /etc/ckan/default/ckan.ini search-index rebuild test-dataset-name

Alternatively, you can use the -o or –only-missing option to only reindex datasets which are notalready indexed

ckan -c /etc/ckan/default/ckan.ini search-index rebuild -o

There is also an option available which works like the refresh option but tries to use all processes on thecomputer to reindex faster

ckan -c /etc/ckan/default/ckan.ini search-index rebuild_fast

There is also an option to clear the whole index first and then rebuild it with all datasets:

ckan -c /etc/ckan/default/ckan.ini search-index rebuild --clear

There are other search related commands, mostly useful for debugging purposes

ckan search-index check - checks for datasets not indexedckan search-index show DATASET_NAME - shows index of a datasetckan search-index clear [DATASET_NAME] - clears the search index for the provided dataset or for the whole ckan instance

sysadmin: Give sysadmin rights

Usage

ckan sysadmin add - convert user into a sysadminckan sysadmin list - list sysadminsckan sysadmin remove - removes user from sysadmins

For example, to make a user called ‘admin’ into a sysadmin

ckan -c /etc/ckan/default/ckan.ini sysadmin add admin

tracking: Update tracking statistics

Usage

ckan tracking update [start_date] - update tracking statsckan tracking export FILE [start_date] - export tracking stats to a csv file

translation: Translation helper functions

Usage

ckan translation js - generate the JavaScript translationsckan translation mangle - mangle the zh_TW translations for testingckan translation check-po - check po files for common mistakes

Note

Since version 2.7 the JavaScript translation files are automaticallyregenerated if necessary when CKAN is started. Hence you usually do notneed to run ckan translation js manually.

user: Create and manage users

Lets you create, remove, list and manage users.

Usage

ckan user add - add new userckan user list - list all usersckan user remove - remove userckan user setpass - set password for the userckan user show - show user

For example, to create a new user called ‘admin’

ckan -c /etc/ckan/default/ckan.ini user add admin

To delete the ‘admin’ user

ckan -c /etc/ckan/default/ckan.ini user remove admin

views: Create views on relevant resources

Usage

ckan views clean - permanently delete views for all types no...ckan views clear - permanently delete all views or the ones with...ckan views create - create views on relevant resources.ckan views --dataset (-d) - Set Datasetckan views --no-default-filtersckan views --search (-s) - Set Searchckan views --yes (-y)

FAQs

What is CKAN used for? ›

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers hundreds of data portals worldwide.

How do you run CKAN? ›

Installing CKAN from source
  1. Install the required packages. ...
  2. Install CKAN into a Python virtual environment. ...
  3. Setup a PostgreSQL database. ...
  4. Create a CKAN config file. ...
  5. Setup Solr. ...
  6. Link to who.ini. ...
  7. Create database tables. ...
  8. Set up the DataStore.

Where is CKAN ini? ›

From CKAN 2.9, by default, the configuration file is located at /etc/ckan/default/ckan. ini .

Who uses CKAN? ›

The Australian Government uses CKAN to make available public data from over 800 different organisations.

What database does CKAN use? ›

Prior to installing CKAN, it is necessary to have PostgreSQL running (CKAN uses PostgreSQL as its database for storing files).

How do I install CKAN on Windows 10? ›

Installing and running
  1. Make sure you have .NET 4.5 installed.
  2. Download ckan.exe (under "Assets") from the latest CKAN release.
  3. Save ckan.exe somewhere you remember. People often place it inside the root of their KSP folder, on their Desktop, or in their user folder. Don't put it in GameData though.
  4. Run ckan.exe.
6 Jan 2022

How do I start a new instance in CKAN? ›

When you get to "New KSP Instance" you can click "Add instance to CKAN" instead of "Clone or fake new instance". Just make sure you've got a new folder made and you're good to go. It will copy the entire base game into the folder so you will have no conflict or issues at all.

Does CKAN work Linux? ›

Arch-based Linux users can install the CKAN client from the Arch User Repository, so don't download anything from here! Mac/Linux/Mono users: please use the cert-sync tool to update mono's certificate store if required.

What is open source data? ›

An open source database has code that is open and free for download, modification and re-use. This is the opposite of a proprietary or closed source database in which the code is protected to prevent copying.

Is an API an application? ›

API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you're using an API.

What is Socrata Open Data? ›

The Socrata Open Data API allows you to programmatically access a wealth of open data resources from governments, non-profits, and NGOs around the world.

How do I install Kerbal mods? ›

In your KSP folder, open the GameData folder. Drag the mod file folder to the GameData folder. That's all there is to it. Next time you load Kerbal Space Program, your mod should load along with it.

How do I use CKAN on Windows? ›

There are three ways to use the CKAN client: Using the GUI (most user friendly, default on Windows and Linux)
...
Using the command line
  1. In the folder where the .exe lives go up one folder.
  2. Hold shift and right-click the folder you just left.
  3. Click "Open command window here"
  4. Type ckan.exe help to get started.
13 Aug 2022

How do I launch KSP with CKAN? ›

On Windows, simply double-click the ckan .exe file. On macOS and Linux you need Mono installed, then run it with "mono ckan .exe", or look for the CKAN entry in your launcher.

How do you install realism overhaul in KSP? ›

Start with a fresh, unadulterated, install of KSP.
...
Pre-Packaged installation via CKAN
  1. Launch the CKAN GUI by double-clicking the ckan .exe in your KSP directory.
  2. Use the Filter to find Realism Overhaul.
  3. Select Realism Overhaul to install.
  4. Click Go To Changes.
  5. Proceed through the menus to select your installation.
16 May 2022

What are Ckan groups? ›

CKAN Organizations are used to create, manage and publish collections of datasets. Users can have different roles within an Organization, depending on their level of authorisation to create, edit and publish.

What is KSP Ckan? ›

What's the CKAN? The CKAN is a metadata repository and associated tools to allow you to find, install, and manage mods for Kerbal Space Program.

Does Ckan work Linux? ›

Arch-based Linux users can install the CKAN client from the Arch User Repository, so don't download anything from here! Mac/Linux/Mono users: please use the cert-sync tool to update mono's certificate store if required.

How do I install Ckan on Windows 10? ›

Installing and running
  1. Make sure you have .NET 4.5 installed.
  2. Download ckan.exe (under "Assets") from the latest CKAN release.
  3. Save ckan.exe somewhere you remember. People often place it inside the root of their KSP folder, on their Desktop, or in their user folder. Don't put it in GameData though.
  4. Run ckan.exe.
6 Jan 2022

How do I add data to Ckan? ›

Adding a new dataset
  1. You can access CKAN's “Create dataset” screen in two ways.
  2. CKAN will ask for the following information about your data. ...
  3. When you have filled in the information on this page, select the “Next: Add Data” button. ...
  4. CKAN will display the “Add data” screen.
  5. Add the other information on the page.

Is Ckan safe? ›

Is ckan safe to use? The python package ckan was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as safe to use.

Do I need mods for Kerbal Space Program? ›

KSP mods are essential for enjoying Kerbal Space Program. It's is a game about going to space, you might even call it a space game, where you plan, design, and fly the bold explorers of Planet Kerbin up towards the final (and only) frontier.

How do I install mods for KSP 2022? ›

In your KSP folder, open the GameData folder. Drag the mod file folder to the GameData folder. That's all there is to it. Next time you load Kerbal Space Program, your mod should load along with it.

How do you install realism overhaul in KSP? ›

Start with a fresh, unadulterated, install of KSP.
...
Pre-Packaged installation via CKAN
  1. Launch the CKAN GUI by double-clicking the ckan .exe in your KSP directory.
  2. Use the Filter to find Realism Overhaul.
  3. Select Realism Overhaul to install.
  4. Click Go To Changes.
  5. Proceed through the menus to select your installation.
16 May 2022

How do I use Ckan on Windows? ›

There are three ways to use the CKAN client: Using the GUI (most user friendly, default on Windows and Linux)
...
Using the command line
  1. In the folder where the .exe lives go up one folder.
  2. Hold shift and right-click the folder you just left.
  3. Click "Open command window here"
  4. Type ckan.exe help to get started.
13 Aug 2022

Top Articles
Latest Posts
Article information

Author: Rob Wisoky

Last Updated: 01/23/2023

Views: 6211

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Rob Wisoky

Birthday: 1994-09-30

Address: 5789 Michel Vista, West Domenic, OR 80464-9452

Phone: +97313824072371

Job: Education Orchestrator

Hobby: Lockpicking, Crocheting, Baton twirling, Video gaming, Jogging, Whittling, Model building

Introduction: My name is Rob Wisoky, I am a smiling, helpful, encouraging, zealous, energetic, faithful, fantastic person who loves writing and wants to share my knowledge and understanding with you.