obsidian_note_cli


Nameobsidian_note_cli JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/guglielmo/obsidian_note_cli.git
SummaryCLI tool to save well-structured notes in Obsidian format
upload_time2024-11-10 15:32:15
maintainerNone
docs_urlNone
authorGuglielmo Celata
requires_python<4.0,>=3.8
licenseNone
keywords cli note-taking obsidian markdown notes documentation frontmatter self-improvement knowledge-management zettelkasten productivity
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Obsidian Note CLI

`obsidian_note_cli` is a command-line tool for creating well-structured notes in Obsidian, complete with front matter metadata like creation date, tags, and status. This tool is designed for users who frequently take notes and want to streamline their note-taking workflow using Obsidian and the command line.

It goes well along with [Daniel Miessler's Fabric](https://github.com/danielmiessler/fabric), as it processes content passed through the stdin as default.


## Features

- Create notes with customizable front matter fields: `created_at`, `tags`, `status`, `source`, and more.
- Specify note content via a file or piped input (Linux-style `stdout | stdin`).
- Set default values for `created_at` at today's date.
- Configuration via environment variables for `vault` and `path`, with sensible defaults

## Installation

### Prerequisites

- Python 3.8 or higher
- [Poetry](https://python-poetry.org/docs/#installation) for managing dependencies and packaging (optional but recommended)
- [pipx](https://pipxproject.github.io/pipx/) for globally installing CLI tools

### Step-by-Step Installation

1. **Clone the Repository**

   ```bash
   git clone https://github.com/guglielmo/obsidian_note_cli.git
   cd obsidian_note_cli
   ```

2. **Build the Package with Poetry**

   ```bash
   poetry build
   ```

### Step 3: Install with pipx

Ensure that `pipx` is installed on your system. Then, use `pipx` to install the latest version of the CLI tool globally:

```bash
pipx install dist/obsidian_note_cli-<VERSION>-py3-none-any.whl
```
   
Replace <VERSION> with the latest version of your package (e.g., 0.1.0).

To check the current version, refer to the version specified in the pyproject.toml file or check the release information in your repository if published.

This makes `obsidian-note` available as a command globally, isolated from other Python environments.


Alternatively, if you are frequently updating and testing new versions, you can specify a specific version or install directly from your local directory after building:

```bash
pipx install dist/obsidian_note_cli-$(poetry version -s)-py3-none-any.whl
```

This command dynamically uses the current version from pyproject.toml by extracting it with poetry version -s.


## Usage

### Basic Usage

To create a note, specify at least the title, vault, and tags:

```bash
obsidian-note --title "My First Note" --vault "MyVault" --path "Notes" --tags "tag1,tag2"
```

This command saves a note in the specified vault and path with the provided title and tags.

### Using Interactive Mode

To enter parameters interactively, use the `--interactively` flag:

```bash
obsidian-note --interactively
```

### Example with Piped Content

You can pipe content into `obsidian-note`:

```bash
echo "This is the note content" | obsidian-note --title "My Piped Note" --vault "MyVault" --path "Notes" --tags "piped,content"
```

### Options

- `--title`: Title of the note.
- `--vault`: Obsidian vault name (default can be set via environment variable `VAULT`).
- `--path`: Path within the vault to save the note (default can be set via environment variable `PATH`).
- `--tags`: Comma-separated list of tags.
- `--status`: Optional status for the note.
- `--created_at`: Date in `YYYY-MM-DD` format (defaults to today).
- `--interactively`: Flag to enter parameters interactively.
- `content`: The content of the note, provided via a file or stdin.

## Configuration via Environment Variables

You can set default values for `vault` and `path` using environment variables:

```bash
export OBSIDIAN_VAULT="MyVault"
export OBSIDIAN_PATH="Notes"
```

This configuration allows you to avoid specifying `--vault` and `--path` for each note.

## Examples

1. **Create a Basic Note**

   ```bash
   obsidian-note --title "Daily Log" --vault "WorkVault" --path "Logs" --tags "daily,log" --status "in-progress"
   ```

2. **Create a Note with Interactive Mode**

   ```bash
   obsidian-note --interactively
   ```

3. **Pipe Content into a Note**

   ```bash
   echo "This is piped content" | obsidian-note --title "Piped Note" --vault "MyVault" --path "Notes" --tags "example,pipe"
   ```

4. **Use with fabric**

   ```bash
   fabric -u https://zettelkasten.de/introduction/ | summarize | \
   obsidian-note --path="09.ReadingList" --source=https://zettelkasten.de/introduction/
   ```

   This is a bit awkward, as for the duplication of the URL, an idea would be to define a bash function:

   ```bash
   function process_note_summarize() {
    local url="$1"
    fabric -u "$url" | summarize | \
    obsidian-note --source="$url" "$@"
   }
   ```

   so that the whole process of reducing the content of the URL to markdown, summarizing it through the AI and sending it to Obsidian, at a specific folder of the default vault, could be expressed as:

   ```bash
   process_note_summarize "https://zettelkasten.de/introduction/" \
      --path 09.ReadingList --tags self_improvement formation 
   ```


## Development

If you want to modify the tool, follow these steps to set up a development environment:

1. Clone the repository and navigate into it:

   ```bash
   git clone https://github.com/yourusername/obsidian_note_cli.git
   cd obsidian_note_cli
   ```

2. Install dependencies using `poetry`:

   ```bash
   poetry install
   ```

3. Run the tool locally with `poetry`:

   ```bash
   poetry run obsidian-note --title "Test Note" --vault "TestVault" --path "TestPath" --tags "test"
   ```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

## Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests.

## Contact

For questions or suggestions, please contact [guglielmo.celata@example.com](mailto:guglielmo.celata@gmail.com).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/guglielmo/obsidian_note_cli.git",
    "name": "obsidian_note_cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "cli, note-taking, obsidian, markdown, notes, documentation, frontmatter, self-improvement, knowledge-management, zettelkasten, productivity",
    "author": "Guglielmo Celata",
    "author_email": "guglielmo.celata@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5a/1e/85b2ca533a84f4171c4cdc31ae5023abe18023dc782967c4fcafb4635ff0/obsidian_note_cli-0.1.5.tar.gz",
    "platform": null,
    "description": "# Obsidian Note CLI\n\n`obsidian_note_cli` is a command-line tool for creating well-structured notes in Obsidian, complete with front matter metadata like creation date, tags, and status. This tool is designed for users who frequently take notes and want to streamline their note-taking workflow using Obsidian and the command line.\n\nIt goes well along with [Daniel Miessler's Fabric](https://github.com/danielmiessler/fabric), as it processes content passed through the stdin as default.\n\n\n## Features\n\n- Create notes with customizable front matter fields: `created_at`, `tags`, `status`, `source`, and more.\n- Specify note content via a file or piped input (Linux-style `stdout | stdin`).\n- Set default values for `created_at` at today's date.\n- Configuration via environment variables for `vault` and `path`, with sensible defaults\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8 or higher\n- [Poetry](https://python-poetry.org/docs/#installation) for managing dependencies and packaging (optional but recommended)\n- [pipx](https://pipxproject.github.io/pipx/) for globally installing CLI tools\n\n### Step-by-Step Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/guglielmo/obsidian_note_cli.git\n   cd obsidian_note_cli\n   ```\n\n2. **Build the Package with Poetry**\n\n   ```bash\n   poetry build\n   ```\n\n### Step 3: Install with pipx\n\nEnsure that `pipx` is installed on your system. Then, use `pipx` to install the latest version of the CLI tool globally:\n\n```bash\npipx install dist/obsidian_note_cli-<VERSION>-py3-none-any.whl\n```\n   \nReplace <VERSION> with the latest version of your package (e.g., 0.1.0).\n\nTo check the current version, refer to the version specified in the pyproject.toml file or check the release information in your repository if published.\n\nThis makes `obsidian-note` available as a command globally, isolated from other Python environments.\n\n\nAlternatively, if you are frequently updating and testing new versions, you can specify a specific version or install directly from your local directory after building:\n\n```bash\npipx install dist/obsidian_note_cli-$(poetry version -s)-py3-none-any.whl\n```\n\nThis command dynamically uses the current version from pyproject.toml by extracting it with poetry version -s.\n\n\n## Usage\n\n### Basic Usage\n\nTo create a note, specify at least the title, vault, and tags:\n\n```bash\nobsidian-note --title \"My First Note\" --vault \"MyVault\" --path \"Notes\" --tags \"tag1,tag2\"\n```\n\nThis command saves a note in the specified vault and path with the provided title and tags.\n\n### Using Interactive Mode\n\nTo enter parameters interactively, use the `--interactively` flag:\n\n```bash\nobsidian-note --interactively\n```\n\n### Example with Piped Content\n\nYou can pipe content into `obsidian-note`:\n\n```bash\necho \"This is the note content\" | obsidian-note --title \"My Piped Note\" --vault \"MyVault\" --path \"Notes\" --tags \"piped,content\"\n```\n\n### Options\n\n- `--title`: Title of the note.\n- `--vault`: Obsidian vault name (default can be set via environment variable `VAULT`).\n- `--path`: Path within the vault to save the note (default can be set via environment variable `PATH`).\n- `--tags`: Comma-separated list of tags.\n- `--status`: Optional status for the note.\n- `--created_at`: Date in `YYYY-MM-DD` format (defaults to today).\n- `--interactively`: Flag to enter parameters interactively.\n- `content`: The content of the note, provided via a file or stdin.\n\n## Configuration via Environment Variables\n\nYou can set default values for `vault` and `path` using environment variables:\n\n```bash\nexport OBSIDIAN_VAULT=\"MyVault\"\nexport OBSIDIAN_PATH=\"Notes\"\n```\n\nThis configuration allows you to avoid specifying `--vault` and `--path` for each note.\n\n## Examples\n\n1. **Create a Basic Note**\n\n   ```bash\n   obsidian-note --title \"Daily Log\" --vault \"WorkVault\" --path \"Logs\" --tags \"daily,log\" --status \"in-progress\"\n   ```\n\n2. **Create a Note with Interactive Mode**\n\n   ```bash\n   obsidian-note --interactively\n   ```\n\n3. **Pipe Content into a Note**\n\n   ```bash\n   echo \"This is piped content\" | obsidian-note --title \"Piped Note\" --vault \"MyVault\" --path \"Notes\" --tags \"example,pipe\"\n   ```\n\n4. **Use with fabric**\n\n   ```bash\n   fabric -u https://zettelkasten.de/introduction/ | summarize | \\\n   obsidian-note --path=\"09.ReadingList\" --source=https://zettelkasten.de/introduction/\n   ```\n\n   This is a bit awkward, as for the duplication of the URL, an idea would be to define a bash function:\n\n   ```bash\n   function process_note_summarize() {\n    local url=\"$1\"\n    fabric -u \"$url\" | summarize | \\\n    obsidian-note --source=\"$url\" \"$@\"\n   }\n   ```\n\n   so that the whole process of reducing the content of the URL to markdown, summarizing it through the AI and sending it to Obsidian, at a specific folder of the default vault, could be expressed as:\n\n   ```bash\n   process_note_summarize \"https://zettelkasten.de/introduction/\" \\\n      --path 09.ReadingList --tags self_improvement formation \n   ```\n\n\n## Development\n\nIf you want to modify the tool, follow these steps to set up a development environment:\n\n1. Clone the repository and navigate into it:\n\n   ```bash\n   git clone https://github.com/yourusername/obsidian_note_cli.git\n   cd obsidian_note_cli\n   ```\n\n2. Install dependencies using `poetry`:\n\n   ```bash\n   poetry install\n   ```\n\n3. Run the tool locally with `poetry`:\n\n   ```bash\n   poetry run obsidian-note --title \"Test Note\" --vault \"TestVault\" --path \"TestPath\" --tags \"test\"\n   ```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contributing\n\nContributions are welcome! Please feel free to open issues or submit pull requests.\n\n## Contact\n\nFor questions or suggestions, please contact [guglielmo.celata@example.com](mailto:guglielmo.celata@gmail.com).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "CLI tool to save well-structured notes in Obsidian format",
    "version": "0.1.5",
    "project_urls": {
        "Homepage": "https://github.com/guglielmo/obsidian_note_cli.git",
        "Repository": "https://github.com/guglielmo/obsidian_note_cli.git"
    },
    "split_keywords": [
        "cli",
        " note-taking",
        " obsidian",
        " markdown",
        " notes",
        " documentation",
        " frontmatter",
        " self-improvement",
        " knowledge-management",
        " zettelkasten",
        " productivity"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b09ff107586269c1ddc9102554a07aabbe99dc9cef60c72dc8a6e581c698638",
                "md5": "9c433df2dff3f830d0767ca1b184f818",
                "sha256": "feae4148055a45743058104ce38b0701c4781eba65024e1216f6ec7d5c392e9c"
            },
            "downloads": -1,
            "filename": "obsidian_note_cli-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c433df2dff3f830d0767ca1b184f818",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 6099,
            "upload_time": "2024-11-10T15:32:13",
            "upload_time_iso_8601": "2024-11-10T15:32:13.939544Z",
            "url": "https://files.pythonhosted.org/packages/1b/09/ff107586269c1ddc9102554a07aabbe99dc9cef60c72dc8a6e581c698638/obsidian_note_cli-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a1e85b2ca533a84f4171c4cdc31ae5023abe18023dc782967c4fcafb4635ff0",
                "md5": "7fa45b2daf3348ae22b309507f0a3e43",
                "sha256": "68b0f44ba59c4aef999aa924ccfa1828c9b940503567992f853568a35ae44d30"
            },
            "downloads": -1,
            "filename": "obsidian_note_cli-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "7fa45b2daf3348ae22b309507f0a3e43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 5138,
            "upload_time": "2024-11-10T15:32:15",
            "upload_time_iso_8601": "2024-11-10T15:32:15.673684Z",
            "url": "https://files.pythonhosted.org/packages/5a/1e/85b2ca533a84f4171c4cdc31ae5023abe18023dc782967c4fcafb4635ff0/obsidian_note_cli-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-10 15:32:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "guglielmo",
    "github_project": "obsidian_note_cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "obsidian_note_cli"
}
        
Elapsed time: 0.36116s