qmk_firmware/assets/cli_configuration.md.CGSB128P.js

16 lines
11 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"QMK CLI Configuration","description":"","frontmatter":{},"headers":[],"relativePath":"cli_configuration.md","filePath":"cli_configuration.md"}');
const _sfc_main = { name: "cli_configuration.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="qmk-cli-configuration" tabindex="-1">QMK CLI Configuration <a class="header-anchor" href="#qmk-cli-configuration" aria-label="Permalink to &quot;QMK CLI Configuration&quot;"></a></h1><p>This document explains how <code>qmk config</code> works.</p><h1 id="introduction" tabindex="-1">Introduction <a class="header-anchor" href="#introduction" aria-label="Permalink to &quot;Introduction&quot;"></a></h1><p>Configuration for the QMK CLI is a key/value system. Each key consists of a subcommand and an argument name separated by a period. This allows for a straightforward and direct translation between config keys and the arguments they set.</p><h2 id="simple-example" tabindex="-1">Simple Example <a class="header-anchor" href="#simple-example" aria-label="Permalink to &quot;Simple Example&quot;"></a></h2><p>As an example let&#39;s look at the command <code>qmk compile --keyboard clueboard/66/rev4 --keymap default</code>.</p><p>There are two command line arguments that could be read from configuration instead:</p><ul><li><code>compile.keyboard</code></li><li><code>compile.keymap</code></li></ul><p>Let&#39;s set these now:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk config compile.keyboard=clueboard/66/rev4 compile.keymap=default</span></span>\n<span class="line"><span>compile.keyboard: None -&gt; clueboard/66/rev4</span></span>\n<span class="line"><span>compile.keymap: None -&gt; default</span></span>\n<span class="line"><span>Ψ Wrote configuration to &#39;/Users/example/Library/Application Support/qmk/qmk.ini&#39;</span></span></code></pre></div><p>Now I can run <code>qmk compile</code> without specifying my keyboard and keymap each time.</p><h2 id="setting-user-defaults" tabindex="-1">Setting User Defaults <a class="header-anchor" href="#setting-user-defaults" aria-label="Permalink to &quot;Setting User Defaults&quot;"></a></h2><p>Sometimes you want to share a setting between multiple commands. For example, multiple commands take the argument <code>--keyboard</code>. Rather than setting this value for every command you can set a user value which will be used by any command that takes that argument.</p><p>Example:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk config user.keyboard=clueboard/66/rev4 user.keymap=default</span></span>\n<span class="line"><span>user.keyboard: None -&gt; clueboard/66/rev4</span></span>\n<span class="line"><span>user.keymap: None -&gt; default</span></span>\n<span class="line"><span>Ψ Wrote configuration to &#39;/Users/example/Library/Application Support/qmk/qmk.ini&#39;</span></span></code></pre></div><h1 id="cli-documentation-qmk-config" tabindex="-1">CLI Documentation (<code>qmk config</code>) <a class="header-anchor" href="#cli-documentation-qmk-config" aria-label="Permalink to &quot;CLI Documentation (`qmk config`)&quot;"></a></h1><p>The <code>qmk config</code> command is used to interact with the underlying configuration. When run with no argument it shows the current configuration. When arguments are supplied they are assumed to be configuration tokens, which are strings containing no spaces with the following form:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>&lt;subcommand|general|default&gt;[.&lt;key&gt;][=&lt;value&gt;]</span></span></code></pre></div><h2 id="setting-configuration-values" tabindex="-1">Setting Configuration Values <a class="header-anchor" href="#setting-configuration-values" aria-label="Permalink to &quot;Setting Configuration Values&quot;"></a></h2><p>You can set configuration values by putting an equal sign (=) into your config key. The key must always be the full <code>&lt;section&gt;.&lt;key&gt;</code> form.</p><p>Example:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk config default.keymap=default</span></span>\n<span class="line"><span>default.keymap: None -&gt; default</span></span>\n<span class="line"><span>Ψ Wrote configuration to &#39;/Users/example/Library/Application Support/qmk/qmk.ini&#39;</span></span></code></pre></div><h2 id="reading-configuration-values" tabindex="-1">Reading Configuration Values <a class="header-anchor" href="#reading-configuration-values" aria-label="Permalink to &quot;Reading Configuration Values&quot;"></a></h2><p>You can read configuration values for the entire configuration, a single key, or for an entire section. You can also specify multiple keys to display more than one value.</p><h3 id="entire-configuration-example" tabindex="-1">Entire Configuration Example <a class="header-anchor" href="#entire-configuration-example" aria-label="Permalink to &quot;Entire Configuration Example&quot;"></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>qmk config</span></span></code></pre></div><h3 id="whole-section-example" tabindex="-1">Whole Section Example <a class="header-anchor" href="#whole-section-example" aria-label="Permalink to &quot;Whole Section Example&quot;"></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>qmk config compile</span></span></code></pre></div><h3 id="single-key-example" tabindex="-1">Single Key Example <a class="header-anchor" href="#single-key-example" aria-label="Permalink to &quot;Single Key Example&quot;"></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>qmk config compile.keyboard</span></span></code></pre></div><h3 id="multiple-keys-example" tabindex="-1">Multiple Keys Example <a class="header-anchor" href="#multiple-keys-example" aria-label="Permalink to &quot;Multiple Keys Example&quot;"></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>qmk config user compile.keyboard compile.keymap</span></span></code></pre></div><h2 id="deleting-configuration-values" tabindex="-1">Deleting Configuration Values <a class="header-anchor" href="#deleting-configuration-values" aria-label="Permalink to &quot;Deleting Configuration Values&quot;"></a></h2><p>You can delete a configuration value by setting it to the special string <code>None</code>.</p><p>Example:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk config default.keymap=None</span></span>\n<span class="line"><span>default.keymap: default -&gt; None</span></span>\n<span class="line"><span>Ψ Wrote configuration to &#39;/Users/example/Library/Application Support/qmk/qmk.ini&#39;</span></span></code></pre></div><h2 id="multiple-operations" tabindex="-1">Multiple Operations <a class="header-anchor" href="#multiple-operations" aria-label="Permalink to &quot;Multiple Operations&quot;"></a></h2><p>You can combine multiple read and write operations into a single command. They will be executed and displayed in order:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>$ qmk config compile default.keymap=default compile.keymap=None</span></span>\n<span class="line"><span>compile.keymap=skully</span></span>\n<span class="line"><span>compile.keyboard=clueboard/66_hotswap/gen1</span></span>\n<span class="line"><span>default.keymap: None -&gt; default</span></span>\n<span class="line"><span>compile.keymap: skully -&gt; None</span></span>\n<span class="line"><span>Ψ Wrote configuration to &#39;/Users/example/Library/Application Support/qmk/qmk.ini&#39;</span></span></code></pre></div><h1 id="user-configuration-options" tabindex="-1">User Configuration Options <a class="header-anchor" href="#user-configuration-options" aria-label="Permalink to &quot;User Configuration Options&quot;"></a></h1><table><thead><tr><th>Key</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td>user.keyboard</td><td>None</td><td>The keyboard path (Example: <code>clueboard/66/rev4</code>)</td></tr><tr><td>user.keymap</td><td>None</td><td>The keymap name (Example: <code>default</code>)</td></tr><tr><td>user.name</td><td>None</td><td>The user&#39;s GitHub username.</td></tr></tbody></table><h1 id="all-configuration-options" tabindex="-1">All Configuration Options <a class="header-anchor" href="#all-configuration-options" aria-label="Permalink to &quot;All Configuration Options&quot;"></a></h1><table><thead><tr><th>Key</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td>compile.keyboard</td><td>None</td><td>The keyboard path (Example: <code>clueboard/66/rev4</code>)</td></tr><tr><td>compile.keymap</td><td>None</td><td>The keymap name (Example: <code>default</code>)</td></tr><tr><td>hello.name</td><td>None</td><td>The name to greet when run.</td></tr><tr><td>new_keyboard.keyboard</td><td>None</td><td>The keyboard path (Example: <code>clueboard/66/rev4</code>)</td></tr><tr><td>new_keyboard.keymap</td><td>None</td><td>The keymap name (Example: <code>default</code>)</td></tr></tbody></table>', 43);
const _hoisted_44 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_44);
}
const cli_configuration = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
cli_configuration as default
};