<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Commands｜林鼎淵 Dean Lin</title>
    <link>https://deanlin.net/tags/commands/</link>
    <image><url>https://deanlin.net/images/author_hu_aa256fc934e9a932.jpg</url><title>Commands｜林鼎淵 Dean Lin</title><link>https://deanlin.net/tags/commands/</link><width>144</width><height>144</height></image>
    <description>林鼎淵（Dean Lin）的部落格：生成式 AI 企業內訓講師、外商資安公司軟體專家、7 本書作者。400 多篇文章用白話分享生成式 AI 實戰、Claude Code 與 Vibe Coding 教學、團隊合作與職場成長。</description>
    <generator>Hugo</generator>
    <language>zh-tw</language>
    <copyright>© 2020–2026 林鼎淵 Dean Lin</copyright>
    <lastBuildDate>Wed, 19 Jun 2024 16:36:55 +0800</lastBuildDate>
    <atom:link href="https://deanlin.net/tags/commands/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Warp AI Terminal：AI 時代工程師的必備利器，從此不再 Google 找指令</title>
      <link>https://deanlin.net/blog/202406/warp-ai-terminal/</link>
      <pubDate>Wed, 19 Jun 2024 16:36:55 +0800</pubDate>
      <guid>https://deanlin.net/blog/202406/warp-ai-terminal/</guid>
      <dc:creator>林鼎淵</dc:creator>
      <category>AI 實戰</category>
      <description>Warp AI 將顛覆你使用終端機（Terminal）體驗，過去我們忘記指令要去 Google，但現在有了 Warp AI，這些問題在 Terminal 就能搞定。 不管是 git、docker 指令，還是想要寫一小段 Shell Script，Warp AI 都能助你一臂之力</description>
      <media:content url="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-og_hu_4a606d3316c9cc18.jpg" medium="image" type="image/jpeg" width="1200" height="675" />
      <content:encoded><![CDATA[<p>對工程師來說，終端機（Terminal）是我們每天都要用到的工具。</p>
<p>也許你已經用習慣 Terminal、iTerm2，但在 AI 時代，我們有更好的選擇。</p>
<p>Warp AI 將顛覆你使用終端機（Terminal）體驗，過去我們忘記指令（Command）可能要去 Google，但現在有了 Warp AI，這些問題在 Terminal 就能搞定。</p>
<p>不管是 git、docker 指令，還是想要寫一小段 Shell Script，Warp AI 都能助你一臂之力。</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-01.webp" width="1148" height="644" alt="Warp AI Terminal：AI 時代工程師的必備利器，從此不再 Google 找指令（圖 1）" fetchpriority="high" decoding="async"></p>
<h2 id="下載-warp">下載 Warp<a class="h-anchor" href="#%e4%b8%8b%e8%bc%89-warp" aria-label="這個段落的連結"></a></h2>
<p>可以透過我的邀請碼下載: <a href="https://app.warp.dev/referral/DDQGLQ">https://app.warp.dev/referral/DDQGLQ</a></p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-02.webp" width="911" height="861" alt="下載 Warp（圖 2）" loading="lazy" decoding="async"></p>
<p>目前 Warp 可以在 Mac、Linux 等平台使用（文章發表時 Windows 尚未開放）。</p>
<p>使用時請遵守公司的資安規定，畢竟這款工具是在 Terminal 運行。</p>
<p>安裝的部分我就不再贅述，下面透過幾個常見的範例，Demo 給大家看他的強大之處。</p>
<p>不過要特別提醒一下，目前僅能使用「英文」來做對話。</p>
<hr>
<h2 id="-warp-基礎操作">Warp 基礎操作<a class="h-anchor" href="#-warp-%e5%9f%ba%e7%a4%8e%e6%93%8d%e4%bd%9c" aria-label="這個段落的連結"></a></h2>
<p>打開 Warp 後，他跟你平常在使用的 Terminal 外型差不多。</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-03.webp" width="1400" height="816" alt="Warp 基礎操作（圖 3）" loading="lazy" decoding="async"></p>
<p>不過如果輸入「#」就會轉換成 AI 對話模式。</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-04.webp" width="1400" height="816" alt="Warp 基礎操作（圖 4）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="-exmaple-1忘記-git-的指令怎麼用">Exmaple 1：忘記 Git 的指令怎麼用<a class="h-anchor" href="#-exmaple-1%e5%bf%98%e8%a8%98-git-%e7%9a%84%e6%8c%87%e4%bb%a4%e6%80%8e%e9%ba%bc%e7%94%a8" aria-label="這個段落的連結"></a></h2>
<p>Git 最常使用的就是 pull/push/merge/fetch… 這些指令。</p>
<p>但如果突然需要使用 rebase 來做版控，你可能就會熊熊忘記這指令怎麼寫，此時在 Warp 直接輸入：</p>
<pre tabindex="0"><code># git rebase to a specific step
</code></pre><p>就會得到 AI 建議嚕！</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-05.webp" width="1400" height="331" alt="Exmaple 1：忘記 Git 的指令怎麼用（圖 5）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="-exmaple-2用模糊名稱找出-docker-images">Exmaple 2：用模糊名稱找出 Docker images<a class="h-anchor" href="#-exmaple-2%e7%94%a8%e6%a8%a1%e7%b3%8a%e5%90%8d%e7%a8%b1%e6%89%be%e5%87%ba-docker-images" aria-label="這個段落的連結"></a></h2>
<p>如果我們想用模糊名稱篩選出 Docker images。</p>
<pre tabindex="0"><code># filter docker images by blurred name
</code></pre><p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-06.webp" width="1400" height="631" alt="Exmaple 2：用模糊名稱找出 Docker images（圖 6）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="-exmaple-3撰寫-shell-script">Exmaple 3：撰寫 Shell Script<a class="h-anchor" href="#-exmaple-3%e6%92%b0%e5%af%ab-shell-script" aria-label="這個段落的連結"></a></h2>
<p>或是請他寫一段 Shell Script，讓我們批量修改某個資料夾底下的檔案名稱。</p>
<pre tabindex="0"><code># write a shell script find specific folder and deep batch rename file under folder
</code></pre><p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-07.webp" width="1400" height="342" alt="Exmaple 3：撰寫 Shell Script（圖 7）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="-使用限制">使用限制<a class="h-anchor" href="#-%e4%bd%bf%e7%94%a8%e9%99%90%e5%88%b6" aria-label="這個段落的連結"></a></h2>
<p>雖然 Warp AI Terminal 很好用，但他有免費額度使用量的限制，目前一個月只能使用 40 次。</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-08.webp" width="1350" height="910" alt="使用限制（圖 8）" loading="lazy" decoding="async"></p>
<p>如果升級到專業版，一個月為 15 元美金，額度提升到 500 次，更詳細的價格請看下圖。</p>
<p><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-09.webp" width="1400" height="870" alt="使用限制（圖 9）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="-使用心得">使用心得<a class="h-anchor" href="#-%e4%bd%bf%e7%94%a8%e5%bf%83%e5%be%97" aria-label="這個段落的連結"></a></h2>
<p>這款 AI 工具的體驗非常絲滑，對我這種不愛記指令（健忘）的工程師來說非常方便。</p>
<p>其他 Terminal 有的功能（ex: 記住用過的指令、快捷鍵）他也都有。</p>
<p>如果你感興趣，可以透過我的邀請碼下載: <a href="https://app.warp.dev/referral/DDQGLQ">https://app.warp.dev/referral/DDQGLQ</a></p>
<p>更多的應用方式，也歡迎大家留言分享喔！</p>
<p><strong>最後提醒一下，AI 生成的答案未必是正確的，你還是要保有自己的判斷能力！</strong></p>
<p><strong>另外也請遵守公司的資安規定來使用，畢竟這款工具是在 Terminal 運行 😀</strong></p>
<a class="linkcard" href="https://deanlin.net/categories/ai/">
  <span class="lc-body">
    <span class="lc-title">AI 實戰</span>
    <span class="lc-desc">實測生成式 AI 工具、Vibe Coding 與自動化流程的第一手心得，把 AI 變成每天都用得上的即戰力。</span>
    <span class="lc-site"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M5 12h14M13 6l6 6-6 6"/></svg>林鼎淵 Dean Lin</span>
  </span>
</a>

<p><strong>想將 AI 導入自己的職場與生活嗎？歡迎<a href="https://www.books.com.tw/products/0011004216">購買筆者出版的新書</a></strong>，幫助您<strong>在 AI 的浪潮中站穩腳步，並在未來的職場競爭中佔據優勢！</strong></p>
<figure class="figure"><img src="https://deanlin.net/blog/202406/warp-ai-terminal/images/warp-ai-terminal-10.webp" width="1400" height="319" alt="林鼎淵著作《ChatGPT 與 AI 繪圖效率大師（新增 Copilot、Gamma、Runway、Suno）》" loading="lazy" decoding="async">
  <figcaption><a href="https://www.books.com.tw/products/0011004216">https://www.books.com.tw/products/0011004216</a></figcaption>
</figure>

]]></content:encoded>
    </item>
    <item>
      <title>Laravel常用指令</title>
      <link>https://deanlin.net/blog/202006/laravel-common-commands/</link>
      <pubDate>Tue, 16 Jun 2020 17:05:47 +0800</pubDate>
      <guid>https://deanlin.net/blog/202006/laravel-common-commands/</guid>
      <dc:creator>林鼎淵</dc:creator>
      <category>技術教學</category>
      <description>laravel有很多常用的指令，但有時候會忘記或是不想自己全部打完，那這篇文章就是你專門用來複製貼上的大補帖</description>
      <media:content url="https://deanlin.net/blog/202006/laravel-common-commands/images/laravel-common-commands-og_hu_9496b00eff300207.jpg" medium="image" type="image/jpeg" width="1200" height="675" />
      <content:encoded><![CDATA[<p><img src="https://deanlin.net/blog/202006/laravel-common-commands/images/laravel-common-commands-01.webp" width="1400" height="583" alt="Laravel常用指令（圖 1）" fetchpriority="high" decoding="async"></p>
<blockquote>
<p>這篇文章會列出我在使用Laraval框架時常用到的指令(部分是套件指令)</p>
</blockquote>
<h2 class="h-nomark" id="1-資料庫相關指令">1. 資料庫相關指令<a class="h-anchor" href="#1-%e8%b3%87%e6%96%99%e5%ba%ab%e7%9b%b8%e9%97%9c%e6%8c%87%e4%bb%a4" aria-label="這個段落的連結"></a></h2>
<p><strong>Migration 資料庫完全重新設定</strong></p>
<pre tabindex="0"><code>php artisan migrate:refresh — seed
</code></pre><p><strong>備份應用程式包括資料庫，<a href="https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/190804/">請確認是否已經安裝plugin</a></strong></p>
<pre tabindex="0"><code>php artisan backup:run
</code></pre><p><strong>備份的資料庫執行</strong></p>
<pre tabindex="0"><code>php artisan backup:run --only-db
</code></pre><p><strong>只需要備份的檔案</strong></p>
<pre tabindex="0"><code>php artisan backup:run --only-files
</code></pre><p><strong>database 還原</strong></p>
<pre tabindex="0"><code>mysql -u root -p database_name &lt; backup.sql
</code></pre><h2 class="h-nomark" id="2-安裝檔遺失相關issue">2. 安裝檔遺失相關issue<a class="h-anchor" href="#2-%e5%ae%89%e8%a3%9d%e6%aa%94%e9%81%ba%e5%a4%b1%e7%9b%b8%e9%97%9cissue" aria-label="這個段落的連結"></a></h2>
<p><strong>composer 全部砍掉重裝</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>rm -rf vendor/
</span></span><span style="display:flex;"><span>composer update -v
</span></span></code></pre></div><h2 class="h-nomark" id="3-laravel-常用指令">3. Laravel 常用指令<a class="h-anchor" href="#3-laravel-%e5%b8%b8%e7%94%a8%e6%8c%87%e4%bb%a4" aria-label="這個段落的連結"></a></h2>
<p><strong>創建model</strong></p>
<pre tabindex="0"><code>php artisan make:model Photo
</code></pre><p><strong>創建controller</strong></p>
<pre tabindex="0"><code>php artisan make:controller UserController
</code></pre><p><strong>創建migration</strong></p>
<pre tabindex="0"><code>php artisan make:migration create_users_table — table=users
</code></pre><p><strong>創建seeder</strong></p>
<pre tabindex="0"><code>php artisan make:seeder UsersTableSeeder
</code></pre><p><strong>創建middleware</strong></p>
<pre tabindex="0"><code>php artisan make:middleware CheckAge
</code></pre><p><strong>創建job</strong></p>
<pre tabindex="0"><code>php artisan make:job SendReminderEmail
</code></pre><p><strong>創建testcase</strong></p>
<pre tabindex="0"><code>php artisan make:test UserTest
</code></pre><h2 class="h-nomark" id="4-php相關指令">4. php相關指令<a class="h-anchor" href="#4-php%e7%9b%b8%e9%97%9c%e6%8c%87%e4%bb%a4" aria-label="這個段落的連結"></a></h2>
<p><strong>尋找php.ini</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo find / -name ‘php.ini’
</span></span></code></pre></div><p><strong>更改php相關設定(如果遇到nginx 502也能用這個重啟嘗試看看)</strong></p>
<pre tabindex="0"><code>vi /etc/php/7.3/fpm/php.ini
service php7.3-fpm restart
</code></pre><h2 class="h-nomark" id="5-單元測試">5. 單元測試<a class="h-anchor" href="#5-%e5%96%ae%e5%85%83%e6%b8%ac%e8%a9%a6" aria-label="這個段落的連結"></a></h2>
<pre tabindex="0"><code>./vendor/bin/phpunit
// 如果使用sudo權限來做測試，部分storage會變成admin權限，這個指令可以讓整個資料夾回歸www-data權限
chown -R www-data:www-data storage/
</code></pre><h2 class="h-nomark" id="6-排程相關">6. 排程相關<a class="h-anchor" href="#6-%e6%8e%92%e7%a8%8b%e7%9b%b8%e9%97%9c" aria-label="這個段落的連結"></a></h2>
<p><strong>排程重啟supervisor</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>// 檔案位置
</span></span><span style="display:flex;"><span>/etc/supervisor/conf.d
</span></span><span style="display:flex;"><span>// 每次修改需要執行這幾個指令重啟<span style="color:#ff7b72;font-weight:bold">(</span>開啟<span style="color:#ff7b72;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>sudo supervisorctl reread
</span></span><span style="display:flex;"><span>sudo supervisorctl update
</span></span><span style="display:flex;"><span>sudo supervisorctl start laravel-worker:*
</span></span><span style="display:flex;"><span>sudo supervisorctl restart laravel-worker:*
</span></span></code></pre></div><p><strong>本機local端測試排程job</strong></p>
<p>下面幾種job為我個人將每個排程進行分類，讓需要較長時間的排程不會影響到其他短時間能完成的排程</p>
<pre tabindex="0"><code>php artisan queue:work — queue=small_job,default — timeout=600 — delay=3 — sleep=3 — tries=3
php artisan queue:work — queue=big_job,default — timeout=7200 — delay=3 — sleep=3 — tries=3
php artisan queue:work — queue=default — delay=3 — sleep=3 — tries=3
</code></pre><h2 class="h-nomark" id="7-查看錯誤訊息">7. 查看錯誤訊息<a class="h-anchor" href="#7-%e6%9f%a5%e7%9c%8b%e9%8c%af%e8%aa%a4%e8%a8%8a%e6%81%af" aria-label="這個段落的連結"></a></h2>
<p>如果為 php 的錯誤訊息</p>
<pre tabindex="0"><code>vi /var/log/php7.3-fpm.log
</code></pre><p>如果為 Laravel 的錯誤訊息</p>
<pre tabindex="0"><code>vi project_path/storage/logs/laravel-xxx-xx.log
</code></pre><blockquote>
<p>從 log 就能推斷出大部分的問題，並取得查詢的關鍵字</p>
</blockquote>
]]></content:encoded>
    </item>
  </channel>
</rss>
