### Package Installation Messages Configuration (JSON) Source: https://context7.com/sublimehq/package_control/llms.txt Configures messages to be displayed during package installation and updates. It maps specific versions or the general 'install' key to text files containing the relevant messages. ```json { "install": "messages/install.txt", "1.0.0": "messages/1.0.0.txt", "1.1.0": "messages/1.1.0.txt", "2.0.0": "messages/2.0.0.txt" } ``` -------------------------------- ### Install Package via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Installs a package programmatically using the Sublime Text console. This command is typically triggered via the Command Palette but can be executed directly in the console for scripting or automation. ```python import sublime sublime.run_command("install_package") ``` -------------------------------- ### Install Package Control via Python Script Source: https://context7.com/sublimehq/package_control/llms.txt This Python script downloads and installs the Package Control plugin for Sublime Text. It uses the `urllib.request` module to fetch the package file from a URL and saves it to the appropriate Sublime Text packages directory. Ensure you have internet connectivity to download the package. ```python from urllib.request import urlretrieve urlretrieve( url="https://download.sublimetext.com/Package%20Control.sublime-package", filename=sublime.installed_packages_path() + '/Package Control.sublime-package' ) ``` -------------------------------- ### Manual Installation of Package Control using Python Source: https://github.com/sublimehq/package_control/blob/master/readme.md This Python script downloads the Package Control.sublime-package file and places it in the correct directory for Sublime Text. It uses the `urllib.request.urlretrieve` function to fetch the file from a given URL. Ensure you have internet connectivity and the correct path to the Sublime Text packages directory. ```python from urllib.request import urlretrieve; urlretrieve(url="https://download.sublimetext.com/Package%20Control.sublime-package", filename=sublime.installed_packages_path() + '/Package Control.sublime-package') ``` -------------------------------- ### List Packages via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Lists all installed packages programmatically using the Sublime Text console. Selecting a package from the list opens its directory, facilitating file access and management. ```python import sublime sublime.run_command("list_packages") ``` -------------------------------- ### Satisfy Libraries via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Ensures all required libraries for installed packages are present and up-to-date by running the 'Satisfy Libraries' command programmatically via the Sublime Text console. ```python import sublime sublime.run_command("satisfy_libraries") ``` -------------------------------- ### Package Definition with Version Selectors Source: https://context7.com/sublimehq/package_control/llms.txt Configures packages with specific releases tailored to different Sublime Text versions and platforms. It allows for granular control over which versions of Sublime Text can install the package and specifies tag prefixes for releases. ```json { "$schema": "sublime://packagecontrol.io/schemas/repository", "schema_version": "4.0.0", "packages": [ { "name": "My Package", "details": "https://github.com/username/my-package", "homepage": "https://mypackage.io", "author": ["author1", "author2"], "labels": ["language syntax", "linting"], "releases": [ { "sublime_text": "<3000", "tags": "st2-" }, { "sublime_text": "3000 - 3999", "tags": "st3-" }, { "sublime_text": ">=4000", "tags": "st4-", "python_versions": ["3.3", "3.8"] } ] } ] } ``` -------------------------------- ### Upgrade Package via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Upgrades installed packages programmatically using the Sublime Text console. This command can upgrade individual packages or all packages at once, typically initiated via the Command Palette. ```python import sublime sublime.run_command("upgrade_package") # Upgrade all packages at once sublime.run_command("upgrade_all_packages") ``` -------------------------------- ### Remove Package via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Removes an installed package programmatically using the Sublime Text console. This command is usually accessed through the Command Palette but can be run directly for automated package management. ```python import sublime sublime.run_command("remove_package") ``` -------------------------------- ### Basic Channel Definition in channel.json Source: https://context7.com/sublimehq/package_control/llms.txt Creates a channel.json file to aggregate multiple package repositories. This allows users to manage packages from various sources through a single channel definition, simplifying repository management. ```json { "$schema": "sublime://packagecontrol.io/schemas/channel", "schema_version": "4.0.0", "repositories": [ "https://packagecontrol.io/packages.json", "./local/repository.json", "file:///absolute/path/to/repository.json", "https://github.com/SublimeText" ] } ``` -------------------------------- ### Create Package File via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Creates a distributable `.sublime-package` file from a package directory programmatically using the Sublime Text console. This command allows selection of packaging profiles like 'Default' or 'Binaries Only'. ```python import sublime sublime.run_command("create_package") ``` -------------------------------- ### Package Control Settings Configuration (JSON) Source: https://context7.com/sublimehq/package_control/llms.txt Customizes the behavior of Package Control, including channel URLs, custom repositories, automatic upgrades, HTTP settings, and VCS integration. This file allows fine-grained control over package management. ```json { "channels": [ "https://packagecontrol.github.io/channel/channel_v4.json", "https://packagecontrol.io/channel_v3.json" ], "repositories": [ "https://github.com/username/my-private-package", "https://my-server.com/repository.json" ], "installed_packages": [ "Package Control", "SublimeLinter", "GitGutter" ], "install_prereleases": [ "LSP" ], "auto_upgrade": true, "auto_upgrade_frequency": 8, "auto_upgrade_ignore": [ "My Custom Package" ], "timeout": 30, "cache_length": 600, "http_proxy": "", "https_proxy": "", "http_basic_auth": { "api.github.com": ["username", "personal_access_token"], "gitlab.com": ["username", "personal_access_token"], "api.bitbucket.org": ["username", "app_password"] }, "ignore_vcs_packages": [], "git_binary": [], "hg_binary": [], "downloader_precedence": { "windows": ["wininet", "oscrypto", "urllib"], "osx": ["urllib", "oscrypto", "curl"], "linux": ["urllib", "oscrypto", "curl", "wget"] }, "dirs_to_ignore": [".git", ".hg", ".svn", ".github"], "files_to_ignore": ["*.pyc", "*.sublime-project", ".gitignore"], "debug": false } ``` -------------------------------- ### Channel Configuration with Package Cache (JSON) Source: https://context7.com/sublimehq/package_control/llms.txt Defines package repositories and caches package and library data within the channel file to optimize performance. It includes details about package releases and library dependencies. ```json { "$schema": "sublime://packagecontrol.io/schemas/channel", "schema_version": "4.0.0", "repositories": [ "https://packagecontrol.io/packages.json" ], "packages_cache": { "https://packagecontrol.io/packages.json": [ { "name": "Alignment", "description": "Multi-line and multiple selection alignment plugin", "author": "wbond", "homepage": "http://wbond.net/sublime_packages/alignment", "releases": [ { "version": "2.0.0", "date": "2011-09-18 20:12:41", "url": "https://packagecontrol.io/Alignment.sublime-package", "sublime_text": "*" } ] } ] }, "libraries_cache": { "https://packagecontrol.io/packages.json": [ { "name": "bz2", "description": "Python bz2 module", "author": "wbond", "issues": "https://github.com/wbond/package_control/issues", "releases": [ { "version": "1.0.0", "date": "2011-09-18 20:12:41", "url": "https://codeload.github.com/codexns/sublime-bz2/zip/1.0.0", "sublime_text": "*", "platforms": ["*"], "python_versions": ["3.3", "3.8"] } ] } ] } } ``` -------------------------------- ### Package Definition with Platform-Specific Assets Source: https://context7.com/sublimehq/package_control/llms.txt Distributes pre-compiled packages with platform-specific binaries. This definition uses the 'asset' and 'platforms' fields to specify different downloadable files for various operating systems and architectures, targeting specific Sublime Text versions. ```json { "$schema": "sublime://packagecontrol.io/schemas/repository", "schema_version": "4.0.0", "packages": [ { "name": "Package With Binaries", "details": "https://github.com/username/package-with-binaries", "releases": [ { "asset": "Package-${version}-${platform}.sublime-package", "platforms": ["linux-arm64", "linux-x64", "osx-arm64", "osx-x64", "windows-x64"], "sublime_text": ">=4107" } ] } ] } ``` -------------------------------- ### Add Repository via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Adds a custom package repository URL programmatically using the Sublime Text console. This allows access to private or custom packages. Supports GitHub, custom JSON repositories, and local paths. ```python import sublime # Add a GitHub repository sublime.run_command("add_repository", { "url": "https://github.com/username/my-sublime-package" }) # Add a custom JSON repository sublime.run_command("add_repository", { "url": "https://my-server.com/repository.json", "unattended": True # Suppress dialogs for automated scripts }) # Add a local repository (converted to file:// URL) sublime.run_command("add_repository", { "url": "/path/to/local/repository.json" }) ``` -------------------------------- ### Basic Package Definition in repository.json Source: https://context7.com/sublimehq/package_control/llms.txt Defines a basic package structure for distribution through Package Control. It includes the package name and a link to its details. This is the simplest form of package definition. ```json { "$schema": "sublime://packagecontrol.io/schemas/repository", "schema_version": "4.0.0", "packages": [ { "name": "My Package", "details": "https://github.com/username/my-sublime-package", "releases": [ { "sublime_text": "*", "tags": true } ] } ] } ``` -------------------------------- ### Add Channel via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Adds a new channel URL programmatically using the Sublime Text console. Channels contain lists of repositories, enabling access to broader sets of packages. Supports unattended addition for scripts. ```python import sublime sublime.run_command("add_channel", { "url": "https://my-server.com/channel.json" }) # Add channel silently (for scripts) sublime.run_command("add_channel", { "url": "https://packagecontrol.github.io/channel/channel_v4.json", "unattended": True }) ``` -------------------------------- ### Package Dependencies Declaration (JSON) Source: https://context7.com/sublimehq/package_control/llms.txt Specifies required libraries for a package, organized by operating system and Sublime Text version. This file ensures that necessary dependencies are available for the package to function correctly. ```json { "$schema": "sublime://packagecontrol.io/schemas/dependencies", "windows": { "<3000": [ "select-windows", "cffi", "cryptography", "pyOpenSSL" ] }, "*": { "*": [ "cffi", "cryptography", "pyOpenSSL" ] } } ``` -------------------------------- ### Enable/Disable Package via Sublime Text Console (Python) Source: https://context7.com/sublimehq/package_control/llms.txt Enables or disables packages programmatically using the Sublime Text console. Disabling a package prevents it from loading without removing its files, while enabling it resumes its loading. ```python # Disable a package (keeps files, stops loading) import sublime sublime.run_command("disable_package") # Re-enable a previously disabled package sublime.run_command("enable_package") ``` -------------------------------- ### Library Definition for Package Dependencies Source: https://context7.com/sublimehq/package_control/llms.txt Defines Python libraries that other Sublime Text packages can declare as dependencies. This allows for shared code and ensures compatibility by specifying library versions and Python interpreter requirements. ```json { "$schema": "sublime://packagecontrol.io/schemas/repository", "schema_version": "4.0.0", "libraries": [ { "name": "my-library", "description": "A Python library for Sublime Text packages", "author": "author", "issues": "https://github.com/username/my-library/issues", "releases": [ { "base": "https://github.com/username/my-library", "tags": true, "platforms": ["*"], "python_versions": ["3.3", "3.8"], "sublime_text": "*" } ] }, { "name": "coverage", "description": "Code coverage library from PyPI", "author": "nedbatchelder", "issues": "https://github.com/nedbat/coveragepy/issues", "releases": [ { "base": "https://pypi.org/project/coverage", "asset": "coverage-*-cp38-cp38-win_amd64.whl", "platforms": ["windows-x64"], "python_versions": ["3.8"] }, { "base": "https://pypi.org/project/coverage", "asset": "coverage-*-cp38-cp38-manylinux_2_5_x86_64*.whl", "platforms": ["linux-x64"], "python_versions": ["3.8"] } ] } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.