### Initializing and Serving a Shinkai Project Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This sequence of commands navigates into the cloned repository, ensures the correct Node.js version is used, installs project dependencies, and then serves a specified project using NX. Replace `{project-name}` with the actual project you wish to run, such as `shinkai-desktop`. ```Shell cd shinkai-apps nvm use npm ci npx nx serve {project-name} # IE: npx nx serve shinkai-desktop ``` -------------------------------- ### Building Shinkai Desktop Application - Shell Source: https://github.com/dcspark/shinkai-apps/blob/main/docs/shinkai-tray-update-system.md This command initiates the build process for the Shinkai Desktop application using the Nx build system. It targets the 'shinkai-desktop' project within the monorepository, generating platform-specific installers, update archives, and signature files for MacOS, Windows, and Linux. This command is a prerequisite for generating all necessary distribution artifacts. ```Shell npx nx build shinkai-desktop ``` -------------------------------- ### Example Shinkai Desktop Update Manifest - JSON Source: https://github.com/dcspark/shinkai-apps/blob/main/docs/shinkai-tray-update-system.md This JSON snippet represents the 'updates.json' manifest file used by the Shinkai Desktop application to check for and deliver updates. It specifies the latest available version, release notes, publication date, and platform-specific update details including the digital signature and the URL to the update artifact. The 'signature' field contains the base64-encoded signature of the update archive, and the 'url' points to the compressed application bundle. ```JSON { "version": "0.5.2202", "notes": "Changed app title", "pub_date": "2024-03-25T17:30:00Z", "platforms": { "darwin-aarch64": { "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVTNG50TktKVkozbXdiZXdua1pvUFVMT0d2M2pwd2g0RlZvck9zTjNNSHZ6TjJsN2ZtaWpnVzAySzFWSXZxckx0TUF6bmRjUHhiMDhsVVo5MTExcnJLR2I2RXNmOXhWRFFvPQp0cnVzdGVkIGNvbW1tZW50OiB0aW1lc3RhbXA6MTcxMTM5ODc3NApmaWxlOlNoaW5rYWkgVHJheS5hcHAudGFyLmd6CkVROWgvcUlLd3B6ZlhLRVRDR0tRQnJuNmdmWEhOeVdZRlVLYmx3RzhGZzFxSUxwTVNVdHM5Sml5cVIyU2d3UHpKS2FFZ2JsSlFuVGx6UWoJd0wzZ1RDUQo=", "url": "https://download.shinkai.com/shinkai-desktop/binaries/development/aarch64-apple-darwin/0.5.2.202/Shinkai-Desktop-0.5.2.202_aarch64-apple-darwin.app.tar.gz" } } } ``` -------------------------------- ### Accessing Translation Function Outside React Components - TypeScript Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-i18n/README.md This example shows how to directly import and use the `t` function from `@shinkai_network/shinkai-i18n` for translation in contexts outside of React components, such as utility functions. This method should be used sparingly, as the `useTranslation` hook is generally preferred for its additional processing. ```TypeScript import { t } from '@shinkai_network/shinkai-i18n'; const myFunction; () => t('functionName.textKey'); ``` -------------------------------- ### Building the Shinkai Desktop Project Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command builds the `shinkai-desktop` project using NX. It compiles the application and its dependencies, preparing it for deployment or further development. ```Shell npx nx build shinkai-desktop ``` -------------------------------- ### Serving Shinkai Desktop for Development Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command serves the `shinkai-desktop` project in development mode, typically making it accessible via a local server. It's used for live development and testing of the application. ```Shell npx nx serve shinkai-desktop ``` -------------------------------- ### Running Tests for Shinkai UI Library Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command executes the test suite for the `shinkai-ui` library. It verifies the functionality and correctness of the reusable React components. ```Shell npx nx test shinkai-ui ``` -------------------------------- ### Running Unit Tests with Nx and Vitest (Shell) Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-artifacts/README.md This command executes the unit tests for the `shinkai-artifacts` library. It leverages Nx for task orchestration and Vitest as the test runner, providing a fast and efficient testing environment. ```shell nx test shinkai-artifacts ``` -------------------------------- ### Downloading Side Binaries for Windows Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command downloads necessary side binaries for Windows (x86_64 architecture) by setting environment variables for Ollama version, Shinkai Node version, and architecture, then executing a TypeScript script. These binaries are prerequisites for running Shinkai applications. ```PowerShell $ENV:OLLAMA_VERSION="v0.6.8"; $ENV:SHINKAI_NODE_VERSION="v1.0.5"; $ENV:ARCH="x86_64-pc-windows-msvc"; npx ts-node ./ci-scripts/download-side-binaries.ts ``` -------------------------------- ### Running Shinkai Desktop as a Tauri App Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command launches the `shinkai-desktop` application as a cross-platform desktop app using the Tauri framework. It automatically builds and serves the application, providing a native desktop experience. ```Shell npx nx serve:tauri shinkai-desktop ``` -------------------------------- ### Creating a Development Build of Shinkai Desktop Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command creates a development build of the `shinkai-desktop` application. It sets a higher Node.js memory limit and uses a specific development configuration file for Tauri, optimizing the build for development purposes. ```Shell NODE_OPTIONS="--max_old_space_size=8192" npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" ``` -------------------------------- ### Building All Projects in the Monorepo Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command initiates the build process for all projects within the monorepo that are configured to be built. It's useful for a full project compilation. ```Shell npx nx run-many --target=build ``` -------------------------------- ### Running Shinkai Desktop as a Web App Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command serves the `shinkai-desktop` application as a web application, making it accessible via a web browser. After execution, the application can be accessed by navigating to `http://localhost:1420`. ```Shell npx nx serve shinkai-desktop ``` -------------------------------- ### Cloning the Shinkai Apps Repository Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command clones the Shinkai Apps GitHub repository to your local machine, providing access to the project's source code. It is the first step required to set up the development environment. ```Shell $ git clone https://github.com/dcSpark/shinkai-apps ``` -------------------------------- ### Running Unit Tests with Nx and Vitest Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-node-state/README.md This command executes the unit tests for the `shinkai-node-state` library using Nx and Vitest. It's a standard way to run tests in an Nx workspace, ensuring code quality and functionality. ```shell nx test shinkai-node-state ``` -------------------------------- ### Downloading Side Binaries for Linux Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command downloads necessary side binaries for Linux (x86_64 architecture) by setting environment variables for architecture, Ollama version, and Shinkai Node version, then executing a TypeScript script. These binaries are prerequisites for running Shinkai applications. ```Shell ARCH="x86_64-unknown-linux-gnu" \ OLLAMA_VERSION="v0.6.8" \ SHINKAI_NODE_VERSION="v1.0.5" \ npx ts-node ./ci-scripts/download-side-binaries.ts ``` -------------------------------- ### Running Unit Tests with Jest in Shinkai UI (Shell) Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-ui/README.md This command executes the unit tests for the `shinkai-ui` library using the Nx build system, which in turn leverages Jest. It ensures the components function as expected and helps maintain code quality. ```Shell nx test shinkai-ui ``` -------------------------------- ### Serving Multiple Projects for Development Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command attempts to serve multiple projects simultaneously for development purposes. This might be useful for scenarios where multiple parts of the application need to run concurrently. ```Shell npx nx run-many --target=serve ``` -------------------------------- ### Downloading Side Binaries for macOS Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command downloads necessary side binaries for macOS (ARM architecture) by setting environment variables for architecture, Ollama version, and Shinkai Node version, then executing a TypeScript script. These binaries are prerequisites for running Shinkai applications. ```Shell ARCH="aarch64-apple-darwin" \ OLLAMA_VERSION="v0.6.8" \ SHINKAI_NODE_VERSION="v1.0.5" \ npx ts-node ./ci-scripts/download-side-binaries.ts ``` -------------------------------- ### Executing a Single NX Task for a Project Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command allows executing a specific task (e.g., build, serve, lint, test, e2e) for a designated project within the monorepo. It leverages NX's dependency inference to build necessary project dependencies automatically. ```Shell npx nx [target] [project-name] ``` -------------------------------- ### Running End-to-End Tests for All Projects Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command executes end-to-end (e2e) tests across all projects in the monorepo. E2E tests simulate user interactions to verify the complete application flow. ```Shell npx nx run-many --target=e2e ``` -------------------------------- ### Running Tests for All Projects in the Monorepo Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command executes the test suites for all projects within the monorepo. It's used to ensure the overall stability and correctness of the entire application suite. ```Shell npx nx run-many --target=test ``` -------------------------------- ### Executing a Single Task Across Many Projects Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command allows executing a specified task (e.g., build, serve, lint, test, e2e) across multiple projects within the monorepo. It's useful for performing a consistent operation on a large set of projects. ```Shell npx nx run-many --target=[target] ``` -------------------------------- ### Linting All Projects in the Monorepo Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command runs linting checks across all projects in the monorepo. It helps maintain consistent code quality and identify issues across the entire codebase. ```Shell npx nx run-many --target=lint ``` -------------------------------- ### Executing a Task on Affected Projects Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command runs a specified task (e.g., build, serve, lint, test, e2e) only on projects that have been affected by recent code changes. This optimizes build and test times by avoiding unnecessary operations on unchanged code. ```Shell npx nx affected --target=[target] ``` -------------------------------- ### Configuring i18nrc.js for New Language Support - JavaScript Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-i18n/README.md This snippet demonstrates how to add a new language, such as Russian (`ru-RU`), to the `outputLocales` array within the `i18nrc.js` configuration file. This step is crucial for enabling i18next to generate translation files for the specified locale. ```JavaScript module.exports = { // ... Other configurations outputLocales: [ 'en-US', 'ja-JP', 'ru-RU', // Add 'ru-RU' to the array ], }; ``` -------------------------------- ### Updating Ollama Models Repository Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command executes a TypeScript script to update the Ollama models repository. It's likely used to fetch or generate the latest information about available Ollama AI models, which Shinkai Apps might utilize. ```Shell npx ts-node ./ci-scripts/generate-ollama-models-repository.ts ``` -------------------------------- ### Linting the Shinkai Message TS Library Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command runs linting checks on the `shinkai-message-ts` library to ensure code quality and adherence to coding standards. It helps identify potential errors and stylistic issues. ```Shell npx nx lint shinkai-message-ts ``` -------------------------------- ### Building Only Affected Projects Source: https://github.com/dcspark/shinkai-apps/blob/main/README.md This command builds only those projects within the monorepo that have been impacted by recent code modifications. It leverages NX's dependency graph to determine the minimal set of projects to rebuild, speeding up the development cycle. ```Shell npx nx affected --target=build ``` -------------------------------- ### Using Trans Component for HTML/JSX in Translations - TypeScript/JSX Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-i18n/README.md This snippet illustrates how to use the `Trans` component from `@shinkai_network/shinkai-i18n` when a translation key contains HTML or JSX elements. The `components` prop allows injecting React elements into specific placeholders within the translated string. ```TypeScript import { useTranslation } from '@shinkai_network/shinkai-i18n'; const Component: React.FC = () => { const { Trans } = useTranslation(); return }} />; }; ``` -------------------------------- ### Using useTranslation Hook in React Components - TypeScript/JSX Source: https://github.com/dcspark/shinkai-apps/blob/main/libs/shinkai-i18n/README.md This code demonstrates the standard way to use the `useTranslation` hook from `@shinkai_network/shinkai-i18n` within a React functional component. It returns the `t` function, which is then used to render translated text by providing a translation key. ```TypeScript import { useTranslation } from '@shinkai_network/shinkai-i18n'; const Component: React.FC = () => { const { t } = useTranslation(); return <>{t('componentName.textKey')}; }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.