# Support for a config subcommand

**URL:** <https://discourse.pijul.org/t/support-for-a-config-subcommand/612>\
**Category:** Development\
**Created:** [November 19, 2020, 8:57am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612 "2020-11-19T08:57:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![arijit79](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/arijit79/32/520_2.png) [@arijit79](https://discourse.pijul.org/u/arijit79)\
**Post date:** [November 19, 2020, 8:57am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/1 "2020-11-19T08:57:11Z")

</div>

There are some things that are required in every change which do not change, such as name, full name and email.

A command something like `pijul config` could be used to set these values globally/locally to the repo. Later, when doing a `record`, these values could be parsed from the configurations to auto fill the values. The configuration format could be in TOML

This removes some typos, errors which can occur while finalizing a change

Opinions are greatly welcomed

---

<div class="post-metadata">

**Author:** ![pmeunier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pmeunier/32/4_2.png) [@pmeunier](https://discourse.pijul.org/u/pmeunier)\
**Post date:** [November 19, 2020, 9:32am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/2 "2020-11-19T09:32:31Z")

</div>

Hi! Have you tried to configure these in `.pijul/config.toml` and `~/.config/pijul/config.toml` (`~/.pijulconfig` on OSX)?

---

<div class="post-metadata">

**Author:** ![arijit79](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/arijit79/32/520_2.png) [@arijit79](https://discourse.pijul.org/u/arijit79)\
**Post date:** [November 19, 2020, 9:47am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/3 "2020-11-19T09:47:33Z")

</div>

No I didn’t try that. There is no documentation about it whatsoever. Could you help me out how to write it

---

<div class="post-metadata">

**Author:** ![pmeunier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pmeunier/32/4_2.png) [@pmeunier](https://discourse.pijul.org/u/pmeunier)\
**Post date:** [November 19, 2020, 10:03am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/4 "2020-11-19T10:03:39Z")

</div>

First, I totally understand your frustration, I get the same when I work with poorly documented stuff I didn’t write.

If you want to help with this, you can send changes to [pijul/manual](https://nest.pijul.com/pijul/manual).

---

<div class="post-metadata">

**Author:** ![arijit79](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/arijit79/32/520_2.png) [@arijit79](https://discourse.pijul.org/u/arijit79)\
**Post date:** [November 19, 2020, 10:14am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/5 "2020-11-19T10:14:04Z")

</div>

Aah! Yeah sure why not. But when I used the term **write** I meant to say how to write that config file

Plus, if you give me the reference of all the keys and values it can have, so I could write the docs

---

<div class="post-metadata">

**Author:** ![pmeunier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pmeunier/32/4_2.png) [@pmeunier](https://discourse.pijul.org/u/pmeunier)\
**Post date:** [November 19, 2020, 10:32am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/6 "2020-11-19T10:32:14Z")

</div>

Alright, so my `~/.config/pijul/config.toml` is exactly this:

```auto
[author]
name = "pmeunier"
full_name = "Pierre-Étienne Meunier"

```

My `pijul/.pijul/config`:

```auto
current_channel = "main"
default_remote = "nest"

[remotes]
nest = "pmeunier@nest.pijul.com:pijul/pijul"

```

The “current\_channel” key is likely to disappear soon from that syntax.

---

<div class="post-metadata">

**Author:** ![arijit79](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/arijit79/32/520_2.png) [@arijit79](https://discourse.pijul.org/u/arijit79)\
**Post date:** [November 19, 2020, 10:44am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/7 "2020-11-19T10:44:45Z")

</div>

Thanks. Are there any more keys/values. So, I tried to put the author details in `pijul/.config/config` that didn’t seem to have any effect. Although the `~/. config/pijul/config.toml` did seem to do the job. It would be nice if we could add support to change it per repository based

Although it’s not a major issue right now

---

<div class="post-metadata">

**Author:** ![qrpnxz](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/qrpnxz/32/303_2.png) [@qrpnxz](https://discourse.pijul.org/u/qrpnxz)\
**Post date:** [November 19, 2020, 2:11pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/8 "2020-11-19T14:11:54Z")

</div>

`author` can also have an `email` field.

Also, iirc it should be `nest.url` on the remotes but that may have changed.

---

<div class="post-metadata">

**Author:** ![arijit79](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/arijit79/32/520_2.png) [@arijit79](https://discourse.pijul.org/u/arijit79)\
**Post date:** [November 19, 2020, 2:27pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/9 "2020-11-19T14:27:29Z")

</div>

Yeah! I did actually try that a few hours ago

---

<div class="post-metadata">

**Author:** ![fyr](https://avatars.discourse-cdn.com/v4/letter/f/b5ac83/32.png) [@fyr](https://discourse.pijul.org/u/fyr)\
**Post date:** [November 19, 2020, 5:17pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/10 "2020-11-19T17:17:50Z")

</div>

> [@pmeunier](#):
>
> `~/.config/pijul/config.toml` ( `~/.pijulconfig` on OSX)?

Any reason not to also go for `~/.config` on OSX? Looking around mine that’s what `fish` and `hub` and `ripgrep` use.

---

<div class="post-metadata">

**Author:** ![krixano](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@krixano](https://discourse.pijul.org/u/krixano)\
**Post date:** [November 19, 2020, 9:31pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/11 "2020-11-19T21:31:06Z")

</div>

This is _very_ useful. Thanks for this!!!

---

<div class="post-metadata">

**Author:** ![porglezomp](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@porglezomp](https://discourse.pijul.org/u/porglezomp)\
**Post date:** [November 24, 2020, 12:57am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/12 "2020-11-24T00:57:58Z")

</div>

Just seconding that macOS should also use `~/.config/pijul/`, that’s the polite place to put command line tool configuration.

---

<div class="post-metadata">

**Author:** ![pmeunier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pmeunier/32/4_2.png) [@pmeunier](https://discourse.pijul.org/u/pmeunier)\
**Post date:** [November 24, 2020, 9:51am UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/13 "2020-11-24T09:51:35Z")

</div>

> [@fyr](#):
>
> Any reason not to also go for `~/.config` on OSX? Looking around mine that’s what `fish` and `hub` and `ripgrep` use.

Pijul will first use the `dirs-next` crate, and if that fails, a bunch of default paths. I’m totally open to changing this way of doing things, but it may be more productive to firstdiscuss this with the authors of `dirs-next`, what do yous think?

---

<div class="post-metadata">

**Author:** ![pksunkara](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pksunkara/32/325_2.png) [@pksunkara](https://discourse.pijul.org/u/pksunkara)\
**Post date:** [December 1, 2020, 2:45pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/14 "2020-12-01T14:45:31Z")

</div>

I actually started working on `config` command yesterday night.

Regarding `dirs-next`, if someone can ask the maintainers and they say no, we can add a default in pijul ourselves.

---

<div class="post-metadata">

**Author:** ![fyr](https://avatars.discourse-cdn.com/v4/letter/f/b5ac83/32.png) [@fyr](https://discourse.pijul.org/u/fyr)\
**Post date:** [December 1, 2020, 3:31pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/15 "2020-12-01T15:31:21Z")

</div>

`dirs-next` says it should put you in `~/Library/Application Support/pijul` - which is a bit of a mouthful, but will I suppose avoid cluttering the home directory.

---

<div class="post-metadata">

**Author:** ![pksunkara](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/pksunkara/32/325_2.png) [@pksunkara](https://discourse.pijul.org/u/pksunkara)\
**Post date:** [December 1, 2020, 7:19pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/16 "2020-12-01T19:19:14Z")

</div>

> **[pijul/pijul - Discussion #152 - Read from \`~/.config/pijul\` even on macos](https://nest.pijul.com/pijul/pijul/discussions/152)**

---

<div class="post-metadata">

**Author:** ![rob](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/rob/32/298_2.png) [@rob](https://discourse.pijul.org/u/rob)\
**Post date:** [December 1, 2020, 10:57pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/17 "2020-12-01T22:57:08Z")

</div>

Here’s a dirs-next issue about this: [https://github.com/xdg-rs/dirs/issues/45](https://github.com/xdg-rs/dirs/issues/45)

---

<div class="post-metadata">

**Author:** ![tae](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/tae/32/81_2.png) [@tae](https://discourse.pijul.org/u/tae)\
**Post date:** [March 16, 2022, 8:34pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/18 "2022-03-16T20:34:13Z")

</div>

If I understood correctly, the code has already been updated on Pijul’s side, so I should be able to use any of these on macOS, right?

- `~/.pijulconfig`
- `~/.confog/pijul/config.toml`
- `~/Library/Application Support/pijul/config.toml`

I’ve tried all of them but `pager = "never"` seems to do nothing 😕 I’m also trying to change my key location as follows:

```auto
[author]
key_path = "/some/path"

```

But Pijul still tries to read it from `~/Library/Application Support/pijul/secretkey.json`. Does anyone have an idea about what I may be doing wrong?

---

<div class="post-metadata">

**Author:** ![joyously](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/joyously/32/266_2.png) [@joyously](https://discourse.pijul.org/u/joyously)\
**Post date:** [March 17, 2022, 3:28pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/19 "2022-03-17T15:28:02Z")

</div>

The manual still doesn’t list the valid keys for the config file. You probably need to read the code to find what is supported.

---

<div class="post-metadata">

**Author:** ![tae](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.pijul.org/tae/32/81_2.png) [@tae](https://discourse.pijul.org/u/tae)\
**Post date:** [March 17, 2022, 3:46pm UTC](https://discourse.pijul.org/t/support-for-a-config-subcommand/612/20 "2022-03-17T15:46:55Z")

</div>

Yep, [I already did it](https://nest.pijul.com/pijul/pijul:main/SXEYMYF7P4RZM.BJPQC). Both keys are supported, that’s why I suspect the file location is the wrong one. Can anyone confirm it?
