Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a 'Beginner Friendly CLI" version of the Getting Started Guide #5295

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/_static/Images/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/configBase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/environmentV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/environtmentV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/extraCommands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/firstImport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/pythonDownload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/successfulImport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/Images/windowsDownload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
276 changes: 276 additions & 0 deletions docs/guides/beginnerCLI.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
Getting Started - Beginner Friendly CLI Windows Guide
===============

Check failure on line 2 in docs/guides/beginnerCLI.rst

View workflow job for this annotation

GitHub Actions / test-docs

Title underline too short.

Welcome to `beets`_! This beginner friendly guide will help you correctly install and configure beets in Windows so you can begin using it to make your music collection better!

Note that this guide is using Windows 11, but following the same steps will also work in Windows 10.

.. _beets: https://beets.io/

Installing
----------

You will need Python.
Beets works on Python 3.8 or later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of specifying the minimum Python version here, I think it's better to link to the Getting Started documentation and tell folks to check the minimum version there. Otherwise, when it comes time to increase the minimum Python version to 3.9, etc., someone has to remember to increment that value here as well. I think it's better to consolidate information about the minimum supported Python version in one place and then link to it to (1) prevent the information from getting out-of-date and (2) minimize work when incrementing the minimum supported Python version.

Copy link
Contributor

@Serene-Arc Serene-Arc Jul 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If people are going to this page to learn that they have to install Python, I think we should just point them to the Python website. They'll have distro-specific instructions and makes sure that they'll get the latest version, which we should be encouraging them to do. Leaving the version out of it would be good moving forwards.


Installing Python
^^^^^^^^^^^^^^^^^
1. If you don't have it, `install Python`_ (you want at least Python 3.8). If you already have Python properly installed and the path set, you may skip this step.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Link to Getting Started documentation instead of specifying minimum Python version here.


* Download the appropriate installer for your PC and follow the installation instructions. In this example, I am using the 64-bit installer.

.. image:: ../_static/Images/windowsDownload.png
:width: 600

* Once you have downloaded and launched the installer, select the *Install Now* option, and take care to remember the path its installing to.

.. image:: ../_static/Images/pythonDownload.png
:align: 600

* Once the installation is complete, press the Windows key and type *Environment Variables* - select the best match that comes up: Edit the System Envrionment Variables.

.. image:: ../_static/Images/env.png
:width: 400

* Select *Environment Variables* at the bottom of the window.

.. image:: ../_static/Images/environmentV.png
:width: 600

* This is where the path from earlier comes in. Under the 'User variables' section, double click the ``path`` variable. Then select *New*. Enter the path where you installed Python. Add ``\Scripts\`` at the end. After select OK in both the edit window and the Environment Variables window.

**IMPORTANT** - If you do not select OK in both windows, it will not save the update and you will have to repeate this step.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeate ➡️ repeat


.. image:: ../_static/Images/path.png
:width: 800

Installing beets
^^^^^^^^^^^^^^^^
2. Press the Windows key and type 'cmd', and then press enter on the Command Prompt. This will open your Command Line Interface. Type ``cd [folder name]`` that you wish to install beets into. Note that you may have to change directories a few times to get to the desired one ex. ``cd users\name\music_library``. For this example, I am saving it to my user so I do not need to change directories.

* Now install beets by running: ``pip install beets``. A successful install will collect and download the included libraries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now use poetry as a recommended installer and package manager.


.. image:: ../_static/Images/install.png
:width: 800

* You're all set! Type ``beet`` at the command prompt to make sure everything's in order. Doing so will bring up a list of helpful commands, as well as the format needed to use them.

.. image:: ../_static/Images/command.png
:width: 600

**Optional** - You may also want to install a context menu item for importing files into beets. Download the `beets.reg`_ file and open it in a text file to make sure the paths to Python match your system. Then double-click the file add the necessary keys to your registry. You can then right-click a directory and
choose "Import with beets".

Configuring
-----------

1. You'll want to set a few basic options before you start using beets. The
:doc:`configuration </reference/config>` is stored in a text file. You
can show its location by running ``beet config -p``, though it may not
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add in a quick word about how it will create the file for you.

exist yet.

**Note:** You will need a text editor for these next steps. If you don't already have one, some popular ones are: `VS Code`_ , `Vim`_, and `Sublime`_. VS Code and Vim are free, but Sublime may come with a price tag. However, if you aren't too keen on downloading one, Windows Notepad will work in this case.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required. Windows comes with a number of text editors what will work just fine for these. We definitely don't need to be recommending a paid application.


.. _VS Code: https://code.visualstudio.com
.. _Vim: https://www.vim.org/download.php
.. _Sublime: https://www.sublimetext.com

2. Locate the path to the and open the config.yaml file. You may notice that when you search, that the file does not exist, even though the path does. To fix this, we can manually create the file within the text editor. I am using VS Code in this example. Hover over *File* in the top left corner of the window and select *Open Folder* from the drop down. Select the location that the ``beet config -p`` command returned. Once there, hover over the folder name, and select the little page and plus icon next to it. This will create the new file. We will name this file *config.yaml*. Double check that the config.yaml and the library.db are in the *same* folder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're not recommending beet config -e?


.. image:: ../_static/Images/config.png
:width: 600

The file will start out empty, but here's a good place to start::

directory: ~/music
library: ~/data/musiclibrary.db

3. Change that first path to a directory where you'd like to keep your music. Then,
for ``library``, choose a good place to keep a database file that keeps an index
of your music library. (The config's format is `YAML`_. You'll want to configure your
text editor to use spaces, not real tabs, for indentation. Also, ``~`` means
your home directory in these paths)

The default configuration assumes you want to start a new organized music folder
(that ``directory`` above) and that you'll *copy* cleaned-up music into that
empty folder using beets' ``import`` command (see below). But you can configure
beets to behave many other ways:

* Start with a new empty directory, but *move* new music in instead of copying
it (saving disk space). Put this in your config file::

import:
move: yes

* Keep your current directory structure; importing should never move or copy
files but instead just correct the tags on music. Put the line ``copy: no``
under the ``import:`` heading in your config file to disable any copying or
renaming. Make sure to point ``directory`` at the place where your music is
currently stored.
Comment on lines +105 to +109
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change the first line; if people are completely new to beets, they might interpret this to mean that beets should never move or change files when importing. Perhaps change it to something about how if they want to preserve the original files, they should choose this.


* Keep your current directory structure and *do not* correct files' tags: leave
files completely unmodified on your disk. (Corrected tags will still be stored
in beets' database, and you can use them to do renaming or tag changes later.)
Put this in your config file::

import:
copy: no
write: no

to disable renaming and tag-writing.

By following this base config set up, your config file should
look similarly to this.

.. image:: ../_static/Images/configBase.png
:width: 800

There are approximately six million other configuration options you can set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A joke is nice, but maybe not with this, just in case it scares them off about exploring more configuration options.

here, including the directory and file naming scheme. See
:doc:`/reference/config` for a full reference.

.. _YAML: https://yaml.org/

Importing Your Library
----------------------

The next step is to import your music files into the beets library database.
Because this can involve modifying files and moving them around, data loss is
always a possibility, so now would be a good time to make sure you have a
recent backup of all your music. We'll wait.

There are two good ways to bring your existing library into beets. You can
either: (a) quickly bring all your files with all their current metadata into
beets' database, or (b) use beets' highly-refined autotagger to find canonical
metadata for every album you import. Option (a) is really fast, but option (b)
makes sure all your songs' tags are exactly right from the get-go. The point
about speed bears repeating: using the autotagger on a large library can take a
very long time, and it's an interactive process. So set aside a good chunk of
time if you're going to go that route. For more on the interactive
tagging process, see :doc:`tagger`.

If you've got time and want to tag all your music right once and for all (option b), do
this::

beet import /path/to/my/music

For this command to work, you must input the full path name.

(Note that by default, this command will *copy music into the directory you
specified above*. If you want to use your current directory structure, set the
``import.copy`` config option.)

A successful import will look as follows:

.. image:: ../_static/Images/firstImport.png
:width: 600

Once imported, follow the prompts in the CLI to tag the music as you see fit.

To take the fast, un-autotagged path (option a), just say::

beet import -A /my/huge/mp3/library

Note that you just need to add ``-A`` for "don't autotag" option.

Adding More Music
-----------------

If you've ripped or... otherwise obtained some new music, you can add it with
the ``beet import`` command, the same way you imported your library. Like so::

beet import ~/some_great_album

This will attempt to autotag the new album (interactively) and add it to your
library. There are, of course, more options for this command---just type ``beet help import`` to see what's available.

Seeing Your Music
-----------------

If you want to query your music library, the ``beet list`` (shortened to ``beet
ls``) command is for you. You give it a :doc:`query string </reference/query>`,
which is formatted something like a Google search, and it gives you a list of
songs. Thus::

beet ls the magnetic fields
The Magnetic Fields - Distortion - Three-Way
The Magnetic Fields - Distortion - California Girls
The Magnetic Fields - Distortion - Old Fools
beet ls hissing gronlandic
of Montreal - Hissing Fauna, Are You the Destroyer? - Gronlandic Edit
beet ls bird
The Knife - The Knife - Bird
The Mae Shi - Terrorbird - Revelation Six
beet ls album:bird
The Mae Shi - Terrorbird - Revelation Six
Comment on lines +195 to +205
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps indent or format this as a shell output; the commands and the output look the same, makes it hard to pick out the shell commands.


By default, a search term will match any of a handful of :ref:`common
attributes <keywordquery>` of songs.
(They're
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe fix the weird line wrapping here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a result of the linting for our docs not being done. It should be corrected automatically when the linter is run.

also implicitly joined by ANDs: a track must match *all* criteria in order to
match the query.) To narrow a search term to a particular metadata field, just
put the field before the term, separated by a : character. So ``album:bird``
only looks for ``bird`` in the "album" field of your songs. (Need to know more?
:doc:`/reference/query/` will answer all your questions.)

The ``beet list`` command also has an ``-a`` option, which searches for albums instead of songs::

beet ls -a forever
Bon Iver - For Emma, Forever Ago
Freezepop - Freezepop Forever

There's also an ``-f`` option (for *format*) that lets you specify what gets displayed in the results of a search::

beet ls -a forever -f "[format] album (year) - artist - title"
[MP3] For Emma, Forever Ago (2009) - Bon Iver - Flume
[AAC] Freezepop Forever (2011) - Freezepop - Harebrained Scheme

In the format option, field references like `$format` and `$year` are filled
in with data from each result. You can see a full list of available fields by
running ``beet fields``.

Beets also has a ``stats`` command, just in case you want to see how much music
you have::

beet stats
Tracks: 13019
Total time: 4.9 weeks
Total size: 71.1 GB
Artists: 548
Albums: 1094

An example of some of these commands will look like this:

.. image:: ../_static/Images/extraCommands.png
:width: 600

If you need more of a walkthrough on configuring and importing libraries, you can read a more in depth and illustrated one `on the
beets blog <https://beets.io/blog/walkthrough.html>`_.

Keep Playing
------------

This is only the beginning of your long and prosperous journey with beets. To
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, nice and upbeat.

keep learning, take a look at :doc:`advanced` for a sampling of what else
is possible. You'll also want to glance over the :doc:`/reference/cli` page
for a more detailed description of all of beets' functionality. (Like
deleting music! That's important.)

Also, check out :doc:`beets' plugins </plugins/index>`. The
real power of beets is in its extensibility---with plugins, beets can do almost
anything for your music collection.

You can always get help using the ``beet help`` command. The plain ``beet help``
command lists all the available commands; then, for example, ``beet help import`` gives more specific help about the ``import`` command.

Want to stay updated on beets? Follow `@b33ts`_ on Twitter to hear about progress on
new versions.

.. _@b33ts: https://twitter.com/b33ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I highly suggest using the Fediverse (Mastodon) link instead of Twitter as the primary way to hear about news about Beets. Reasons:

  1. Fediverse/Mastodon is built on open source, just like Beets.
  2. One of the more unsavory moves at Twitter is that they now require everyone to log in just to see Beets-related news/tweets, whereas anyone can read Beets-related news on the Fediverse without having to log in.

If it were up to me, I would remove the Twitter link entirely from this documentation, just based on (2) above. But if you are determined to include a Twitter link, at the very least I recommend swapping the two, so that the Fediverse link is primary and the part below says:

Please let us know what you think of beets via `the discussion board`_ or `Twitter`_.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, phase out Twitter. Mastodon is at least semi-active now and you'll get version release toots whenever we do a release now!


Please let us know what you think of beets via `the discussion board`_ or
`Mastodon`_.

.. _the mailing list: https://groups.google.com/group/beets-users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...if this mailing list is still active, I'm not on it, which would be a bit concerning. Maybe let's not encourage its use.

.. _the discussion board: https://github.com/beetbox/beets/discussions
.. _mastodon: https://fosstodon.org/@beets
2 changes: 2 additions & 0 deletions docs/guides/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Getting Started
Welcome to `beets`_! This guide will help you begin using it to make your music
collection better.

New to the CLI? Check out our :doc:`beginner friendly</guides/beginnerCLI>` getting started guide for Windows!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it would be better to name-space the documentation and thus this link to it:

/guides/beginnerCLI ➡️ /guides/beginner-cli-windows


.. _beets: https://beets.io/

Installing
Expand Down
Loading